@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,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToolError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* An error that can be thrown from a tool's `run` method to return structured
|
|
6
|
+
* content blocks as the error result, rather than just a string message.
|
|
7
|
+
*
|
|
8
|
+
* When the ToolRunner catches this error, it will use the `content` property
|
|
9
|
+
* as the tool result with `is_error: true`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const tool = {
|
|
14
|
+
* name: 'my_tool',
|
|
15
|
+
* run: async (input) => {
|
|
16
|
+
* if (somethingWentWrong) {
|
|
17
|
+
* throw new ToolError([
|
|
18
|
+
* { type: 'text', text: 'Error details here' },
|
|
19
|
+
* { type: 'image', source: { type: 'base64', data: '...', media_type: 'image/png' } },
|
|
20
|
+
* ]);
|
|
21
|
+
* }
|
|
22
|
+
* return 'success';
|
|
23
|
+
* },
|
|
24
|
+
* };
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
class ToolError extends Error {
|
|
28
|
+
/**
|
|
29
|
+
* The content to return as the tool result. This will be sent back to the model
|
|
30
|
+
* with `is_error: true`.
|
|
31
|
+
*/
|
|
32
|
+
content;
|
|
33
|
+
constructor(content) {
|
|
34
|
+
const message = typeof content === 'string' ? content : (content
|
|
35
|
+
.map((block) => {
|
|
36
|
+
if (block.type === 'text')
|
|
37
|
+
return block.text;
|
|
38
|
+
return `[${block.type}]`;
|
|
39
|
+
})
|
|
40
|
+
.join(' '));
|
|
41
|
+
super(message);
|
|
42
|
+
this.name = 'ToolError';
|
|
43
|
+
this.content = content;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.ToolError = ToolError;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformJSONSchema = transformJSONSchema;
|
|
4
|
+
const utils_1 = require("../internal/utils");
|
|
5
|
+
// Supported string formats
|
|
6
|
+
const SUPPORTED_STRING_FORMATS = new Set([
|
|
7
|
+
'date-time',
|
|
8
|
+
'time',
|
|
9
|
+
'date',
|
|
10
|
+
'duration',
|
|
11
|
+
'email',
|
|
12
|
+
'hostname',
|
|
13
|
+
'uri',
|
|
14
|
+
'ipv4',
|
|
15
|
+
'ipv6',
|
|
16
|
+
'uuid',
|
|
17
|
+
]);
|
|
18
|
+
function deepClone(obj) {
|
|
19
|
+
return JSON.parse(JSON.stringify(obj));
|
|
20
|
+
}
|
|
21
|
+
function transformJSONSchema(jsonSchema) {
|
|
22
|
+
const workingCopy = deepClone(jsonSchema);
|
|
23
|
+
return _transformJSONSchema(workingCopy);
|
|
24
|
+
}
|
|
25
|
+
function _transformJSONSchema(jsonSchema) {
|
|
26
|
+
const strictSchema = {};
|
|
27
|
+
const ref = (0, utils_1.pop)(jsonSchema, '$ref');
|
|
28
|
+
if (ref !== undefined) {
|
|
29
|
+
strictSchema['$ref'] = ref;
|
|
30
|
+
return strictSchema;
|
|
31
|
+
}
|
|
32
|
+
const defs = (0, utils_1.pop)(jsonSchema, '$defs');
|
|
33
|
+
if (defs !== undefined) {
|
|
34
|
+
const strictDefs = {};
|
|
35
|
+
strictSchema['$defs'] = strictDefs;
|
|
36
|
+
for (const [name, defSchema] of Object.entries(defs)) {
|
|
37
|
+
strictDefs[name] = _transformJSONSchema(defSchema);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const type = (0, utils_1.pop)(jsonSchema, 'type');
|
|
41
|
+
const anyOf = (0, utils_1.pop)(jsonSchema, 'anyOf');
|
|
42
|
+
const oneOf = (0, utils_1.pop)(jsonSchema, 'oneOf');
|
|
43
|
+
const allOf = (0, utils_1.pop)(jsonSchema, 'allOf');
|
|
44
|
+
if (Array.isArray(anyOf)) {
|
|
45
|
+
strictSchema['anyOf'] = anyOf.map((variant) => _transformJSONSchema(variant));
|
|
46
|
+
}
|
|
47
|
+
else if (Array.isArray(oneOf)) {
|
|
48
|
+
strictSchema['anyOf'] = oneOf.map((variant) => _transformJSONSchema(variant));
|
|
49
|
+
}
|
|
50
|
+
else if (Array.isArray(allOf)) {
|
|
51
|
+
strictSchema['allOf'] = allOf.map((entry) => _transformJSONSchema(entry));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
if (type === undefined) {
|
|
55
|
+
throw new Error('JSON schema must have a type defined if anyOf/oneOf/allOf are not used');
|
|
56
|
+
}
|
|
57
|
+
strictSchema['type'] = type;
|
|
58
|
+
}
|
|
59
|
+
const description = (0, utils_1.pop)(jsonSchema, 'description');
|
|
60
|
+
if (description !== undefined) {
|
|
61
|
+
strictSchema['description'] = description;
|
|
62
|
+
}
|
|
63
|
+
const title = (0, utils_1.pop)(jsonSchema, 'title');
|
|
64
|
+
if (title !== undefined) {
|
|
65
|
+
strictSchema['title'] = title;
|
|
66
|
+
}
|
|
67
|
+
if (type === 'object') {
|
|
68
|
+
const properties = (0, utils_1.pop)(jsonSchema, 'properties') || {};
|
|
69
|
+
strictSchema['properties'] = Object.fromEntries(Object.entries(properties).map(([key, propSchema]) => [
|
|
70
|
+
key,
|
|
71
|
+
_transformJSONSchema(propSchema),
|
|
72
|
+
]));
|
|
73
|
+
(0, utils_1.pop)(jsonSchema, 'additionalProperties');
|
|
74
|
+
strictSchema['additionalProperties'] = false;
|
|
75
|
+
const required = (0, utils_1.pop)(jsonSchema, 'required');
|
|
76
|
+
if (required !== undefined) {
|
|
77
|
+
strictSchema['required'] = required;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else if (type === 'string') {
|
|
81
|
+
const format = (0, utils_1.pop)(jsonSchema, 'format');
|
|
82
|
+
if (format !== undefined && SUPPORTED_STRING_FORMATS.has(format)) {
|
|
83
|
+
strictSchema['format'] = format;
|
|
84
|
+
}
|
|
85
|
+
else if (format !== undefined) {
|
|
86
|
+
jsonSchema['format'] = format;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else if (type === 'array') {
|
|
90
|
+
const items = (0, utils_1.pop)(jsonSchema, 'items');
|
|
91
|
+
if (items !== undefined) {
|
|
92
|
+
strictSchema['items'] = _transformJSONSchema(items);
|
|
93
|
+
}
|
|
94
|
+
const minItems = (0, utils_1.pop)(jsonSchema, 'minItems');
|
|
95
|
+
if (minItems !== undefined && (minItems === 0 || minItems === 1)) {
|
|
96
|
+
strictSchema['minItems'] = minItems;
|
|
97
|
+
}
|
|
98
|
+
else if (minItems !== undefined) {
|
|
99
|
+
jsonSchema['minItems'] = minItems;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (Object.keys(jsonSchema).length > 0) {
|
|
103
|
+
const existingDescription = strictSchema['description'];
|
|
104
|
+
strictSchema['description'] =
|
|
105
|
+
(existingDescription ? existingDescription + '\n\n' : '') +
|
|
106
|
+
'{' +
|
|
107
|
+
Object.entries(jsonSchema)
|
|
108
|
+
.map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
|
|
109
|
+
.join(', ') +
|
|
110
|
+
'}';
|
|
111
|
+
}
|
|
112
|
+
return strictSchema;
|
|
113
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/** @deprecated Import from ./core/pagination instead */
|
|
18
|
+
__exportStar(require("./core/pagination"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/** @deprecated Import from ./core/resource instead */
|
|
18
|
+
__exportStar(require("./core/resource"), exports);
|
|
@@ -0,0 +1,159 @@
|
|
|
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.Agents = void 0;
|
|
38
|
+
const resource_1 = require("../../../core/resource");
|
|
39
|
+
const VersionsAPI = __importStar(require("./versions"));
|
|
40
|
+
const versions_1 = require("./versions");
|
|
41
|
+
const pagination_1 = require("../../../core/pagination");
|
|
42
|
+
const headers_1 = require("../../../internal/headers");
|
|
43
|
+
const path_1 = require("../../../internal/utils/path");
|
|
44
|
+
class Agents extends resource_1.APIResource {
|
|
45
|
+
versions = new VersionsAPI.Versions(this._client);
|
|
46
|
+
/**
|
|
47
|
+
* Create Agent
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const betaManagedAgentsAgent =
|
|
52
|
+
* await client.beta.agents.create({
|
|
53
|
+
* model: 'puku-ai-2.8',
|
|
54
|
+
* name: 'My First Agent',
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
create(params, options) {
|
|
59
|
+
const { betas, ...body } = params;
|
|
60
|
+
return this._client.post('/v1/agents?beta=true', {
|
|
61
|
+
body,
|
|
62
|
+
...options,
|
|
63
|
+
headers: (0, headers_1.buildHeaders)([
|
|
64
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
65
|
+
options?.headers,
|
|
66
|
+
]),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get Agent
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const betaManagedAgentsAgent =
|
|
75
|
+
* await client.beta.agents.retrieve(
|
|
76
|
+
* 'agent_011CZkYpogX7uDKUyvBTophP',
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
retrieve(agentID, params = {}, options) {
|
|
81
|
+
const { betas, ...query } = params ?? {};
|
|
82
|
+
return this._client.get((0, path_1.path) `/v1/agents/${agentID}?beta=true`, {
|
|
83
|
+
query,
|
|
84
|
+
...options,
|
|
85
|
+
headers: (0, headers_1.buildHeaders)([
|
|
86
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
87
|
+
options?.headers,
|
|
88
|
+
]),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Update Agent
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* const betaManagedAgentsAgent =
|
|
97
|
+
* await client.beta.agents.update(
|
|
98
|
+
* 'agent_011CZkYpogX7uDKUyvBTophP',
|
|
99
|
+
* { description: 'updated' },
|
|
100
|
+
* );
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
update(agentID, params, options) {
|
|
104
|
+
const { betas, ...body } = params;
|
|
105
|
+
return this._client.post((0, path_1.path) `/v1/agents/${agentID}?beta=true`, {
|
|
106
|
+
body,
|
|
107
|
+
...options,
|
|
108
|
+
headers: (0, headers_1.buildHeaders)([
|
|
109
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
110
|
+
options?.headers,
|
|
111
|
+
]),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* List Agents
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* // Automatically fetches more pages as needed.
|
|
120
|
+
* for await (const betaManagedAgentsAgent of client.beta.agents.list()) {
|
|
121
|
+
* // ...
|
|
122
|
+
* }
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
list(params = {}, options) {
|
|
126
|
+
const { betas, ...query } = params ?? {};
|
|
127
|
+
return this._client.getAPIList('/v1/agents?beta=true', (pagination_1.PageCursor), {
|
|
128
|
+
query,
|
|
129
|
+
...options,
|
|
130
|
+
headers: (0, headers_1.buildHeaders)([
|
|
131
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
132
|
+
options?.headers,
|
|
133
|
+
]),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Archive Agent
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```ts
|
|
141
|
+
* const betaManagedAgentsAgent =
|
|
142
|
+
* await client.beta.agents.archive(
|
|
143
|
+
* 'agent_011CZkYpogX7uDKUyvBTophP',
|
|
144
|
+
* );
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
archive(agentID, params = {}, options) {
|
|
148
|
+
const { betas } = params ?? {};
|
|
149
|
+
return this._client.post((0, path_1.path) `/v1/agents/${agentID}/archive?beta=true`, {
|
|
150
|
+
...options,
|
|
151
|
+
headers: (0, headers_1.buildHeaders)([
|
|
152
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
153
|
+
options?.headers,
|
|
154
|
+
]),
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.Agents = Agents;
|
|
159
|
+
Agents.Versions = versions_1.Versions;
|
|
@@ -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.Versions = exports.Agents = void 0;
|
|
5
|
+
var agents_1 = require("./agents");
|
|
6
|
+
Object.defineProperty(exports, "Agents", { enumerable: true, get: function () { return agents_1.Agents; } });
|
|
7
|
+
var versions_1 = require("./versions");
|
|
8
|
+
Object.defineProperty(exports, "Versions", { enumerable: true, get: function () { return versions_1.Versions; } });
|
|
@@ -0,0 +1,35 @@
|
|
|
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.Versions = 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 Versions extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* List Agent Versions
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* // Automatically fetches more pages as needed.
|
|
16
|
+
* for await (const betaManagedAgentsAgent of client.beta.agents.versions.list(
|
|
17
|
+
* 'agent_011CZkYpogX7uDKUyvBTophP',
|
|
18
|
+
* )) {
|
|
19
|
+
* // ...
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
list(agentID, params = {}, options) {
|
|
24
|
+
const { betas, ...query } = params ?? {};
|
|
25
|
+
return this._client.getAPIList((0, path_1.path) `/v1/agents/${agentID}/versions?beta=true`, (pagination_1.PageCursor), {
|
|
26
|
+
query,
|
|
27
|
+
...options,
|
|
28
|
+
headers: (0, headers_1.buildHeaders)([
|
|
29
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
30
|
+
options?.headers,
|
|
31
|
+
]),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.Versions = Versions;
|
|
@@ -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("./agents/index"), exports);
|
|
@@ -0,0 +1,105 @@
|
|
|
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.Beta = void 0;
|
|
38
|
+
const resource_1 = require("../../core/resource");
|
|
39
|
+
const DeploymentRunsAPI = __importStar(require("./deployment-runs"));
|
|
40
|
+
const deployment_runs_1 = require("./deployment-runs");
|
|
41
|
+
const DeploymentsAPI = __importStar(require("./deployments"));
|
|
42
|
+
const deployments_1 = require("./deployments");
|
|
43
|
+
const DreamsAPI = __importStar(require("./dreams"));
|
|
44
|
+
const dreams_1 = require("./dreams");
|
|
45
|
+
const FilesAPI = __importStar(require("./files"));
|
|
46
|
+
const files_1 = require("./files");
|
|
47
|
+
const ModelsAPI = __importStar(require("./models"));
|
|
48
|
+
const models_1 = require("./models");
|
|
49
|
+
const UserProfilesAPI = __importStar(require("./user-profiles"));
|
|
50
|
+
const user_profiles_1 = require("./user-profiles");
|
|
51
|
+
const WebhooksAPI = __importStar(require("./webhooks"));
|
|
52
|
+
const webhooks_1 = require("./webhooks");
|
|
53
|
+
const AgentsAPI = __importStar(require("./agents/agents"));
|
|
54
|
+
const agents_1 = require("./agents/agents");
|
|
55
|
+
const EnvironmentsAPI = __importStar(require("./environments/environments"));
|
|
56
|
+
const environments_1 = require("./environments/environments");
|
|
57
|
+
const MemoryStoresAPI = __importStar(require("./memory-stores/memory-stores"));
|
|
58
|
+
const memory_stores_1 = require("./memory-stores/memory-stores");
|
|
59
|
+
const MessagesAPI = __importStar(require("./messages/messages"));
|
|
60
|
+
const messages_1 = require("./messages/messages");
|
|
61
|
+
const OrganizationAPI = __importStar(require("./organization/organization"));
|
|
62
|
+
const organization_1 = require("./organization/organization");
|
|
63
|
+
const SessionsAPI = __importStar(require("./sessions/sessions"));
|
|
64
|
+
const sessions_1 = require("./sessions/sessions");
|
|
65
|
+
const SkillsAPI = __importStar(require("./skills/skills"));
|
|
66
|
+
const skills_1 = require("./skills/skills");
|
|
67
|
+
const TunnelsAPI = __importStar(require("./tunnels/tunnels"));
|
|
68
|
+
const tunnels_1 = require("./tunnels/tunnels");
|
|
69
|
+
const VaultsAPI = __importStar(require("./vaults/vaults"));
|
|
70
|
+
const vaults_1 = require("./vaults/vaults");
|
|
71
|
+
class Beta extends resource_1.APIResource {
|
|
72
|
+
models = new ModelsAPI.Models(this._client);
|
|
73
|
+
messages = new MessagesAPI.Messages(this._client);
|
|
74
|
+
agents = new AgentsAPI.Agents(this._client);
|
|
75
|
+
environments = new EnvironmentsAPI.Environments(this._client);
|
|
76
|
+
sessions = new SessionsAPI.Sessions(this._client);
|
|
77
|
+
deployments = new DeploymentsAPI.Deployments(this._client);
|
|
78
|
+
deploymentRuns = new DeploymentRunsAPI.DeploymentRuns(this._client);
|
|
79
|
+
vaults = new VaultsAPI.Vaults(this._client);
|
|
80
|
+
memoryStores = new MemoryStoresAPI.MemoryStores(this._client);
|
|
81
|
+
files = new FilesAPI.Files(this._client);
|
|
82
|
+
skills = new SkillsAPI.Skills(this._client);
|
|
83
|
+
webhooks = new WebhooksAPI.Webhooks(this._client);
|
|
84
|
+
userProfiles = new UserProfilesAPI.UserProfiles(this._client);
|
|
85
|
+
dreams = new DreamsAPI.Dreams(this._client);
|
|
86
|
+
tunnels = new TunnelsAPI.Tunnels(this._client);
|
|
87
|
+
organization = new OrganizationAPI.Organization(this._client);
|
|
88
|
+
}
|
|
89
|
+
exports.Beta = Beta;
|
|
90
|
+
Beta.Models = models_1.Models;
|
|
91
|
+
Beta.Messages = messages_1.Messages;
|
|
92
|
+
Beta.Agents = agents_1.Agents;
|
|
93
|
+
Beta.Environments = environments_1.Environments;
|
|
94
|
+
Beta.Sessions = sessions_1.Sessions;
|
|
95
|
+
Beta.Deployments = deployments_1.Deployments;
|
|
96
|
+
Beta.DeploymentRuns = deployment_runs_1.DeploymentRuns;
|
|
97
|
+
Beta.Vaults = vaults_1.Vaults;
|
|
98
|
+
Beta.MemoryStores = memory_stores_1.MemoryStores;
|
|
99
|
+
Beta.Files = files_1.Files;
|
|
100
|
+
Beta.Skills = skills_1.Skills;
|
|
101
|
+
Beta.Webhooks = webhooks_1.Webhooks;
|
|
102
|
+
Beta.UserProfiles = user_profiles_1.UserProfiles;
|
|
103
|
+
Beta.Dreams = dreams_1.Dreams;
|
|
104
|
+
Beta.Tunnels = tunnels_1.Tunnels;
|
|
105
|
+
Beta.Organization = organization_1.Organization;
|
|
@@ -0,0 +1,54 @@
|
|
|
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.DeploymentRuns = 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 DeploymentRuns extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Get Deployment Run
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const betaManagedAgentsDeploymentRun =
|
|
16
|
+
* await client.beta.deploymentRuns.retrieve(
|
|
17
|
+
* 'deployment_run_id',
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
retrieve(deploymentRunID, params = {}, options) {
|
|
22
|
+
const { betas } = params ?? {};
|
|
23
|
+
return this._client.get((0, path_1.path) `/v1/deployment_runs/${deploymentRunID}?beta=true`, {
|
|
24
|
+
...options,
|
|
25
|
+
headers: (0, headers_1.buildHeaders)([
|
|
26
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
27
|
+
options?.headers,
|
|
28
|
+
]),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* List Deployment Runs
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* // Automatically fetches more pages as needed.
|
|
37
|
+
* for await (const betaManagedAgentsDeploymentRun of client.beta.deploymentRuns.list()) {
|
|
38
|
+
* // ...
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
list(params = {}, options) {
|
|
43
|
+
const { betas, ...query } = params ?? {};
|
|
44
|
+
return this._client.getAPIList('/v1/deployment_runs?beta=true', (pagination_1.PageCursor), {
|
|
45
|
+
query,
|
|
46
|
+
...options,
|
|
47
|
+
headers: (0, headers_1.buildHeaders)([
|
|
48
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
49
|
+
options?.headers,
|
|
50
|
+
]),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.DeploymentRuns = DeploymentRuns;
|