@usenaive-sdk/managed-agents 0.12.0 → 0.12.1
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/dist/index.d.ts +5 -3
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3856,12 +3856,14 @@ interface ToolSettings {
|
|
|
3856
3856
|
*/
|
|
3857
3857
|
declare function withTool(tools: Toolset, name: string, settings: ToolSettings): Toolset;
|
|
3858
3858
|
|
|
3859
|
+
/** The API origin. Every route already starts with `/v1`, so a baseUrl ending in `/v1` is trimmed back to it. */
|
|
3860
|
+
declare const DEFAULT_BASE_URL = "https://api.vetta.sh";
|
|
3859
3861
|
/**
|
|
3860
|
-
* Only `
|
|
3862
|
+
* Only `apiKey` is required; `baseUrl` defaults to `https://api.vetta.sh`. Left out, `fetch` is the global one, looked up per call
|
|
3861
3863
|
* (so a stub or polyfill installed after the client is made still applies), and `idempotencyKey` is
|
|
3862
3864
|
* a random UUID per write. Tests and the CLI still inject both.
|
|
3863
3865
|
*/
|
|
3864
|
-
declare function createClient(options: Partial<ClientConfig> & Pick<ClientConfig, "
|
|
3866
|
+
declare function createClient(options: Partial<ClientConfig> & Pick<ClientConfig, "apiKey">): {
|
|
3865
3867
|
config: ClientConfig;
|
|
3866
3868
|
agents: {
|
|
3867
3869
|
create: (body: AgentCreate) => Promise<{
|
|
@@ -13293,4 +13295,4 @@ declare function createClient(options: Partial<ClientConfig> & Pick<ClientConfig
|
|
|
13293
13295
|
};
|
|
13294
13296
|
type VettaClient = ReturnType<typeof createClient>;
|
|
13295
13297
|
|
|
13296
|
-
export { type AdAccount, type AgentCreate, type AgentPatch, ApiError, type AppCreate, type AppOption, type AppPatch, type AuditFilter, type AuthConfig, type AuthConfigCreate, type AuthSession, type BrowserActionRequest, type BrowserCredential, type BrowserLogin, type BrowserOptionsInput, type BrowserSignup, type Build3dRequestInput, type Build3dResult, CONNECTION_AUTHS, type Call, type CardCreate, type CardPatch, type Character, type CharacterCreate, type CharacterFilter, type ClientConfig, type ClipCreate, type ClipFilter, type CloseTradingPosition, type ComputerCreate, type Connection, type ConnectionApp, type ConnectionAppDetail, type ConnectionAuth, type ConnectionField, type ConnectionStatus, type Connector, type CreateBrowserGrant, type CredentialCreate, type CrmActivityCreate, type CrmActivityUpdate, type CrmContactCreate, type CrmContactUpdate, type DataDomain, type DataRun, type DataRunRequest, type DataTool, type DataToolDetail, type DataToolSearch, type DbFilter, type DbOptions, type DbPage, type DeploymentCreate, type DeploymentPatch, type DomainCreate, type DomainPurchase, type EditJob, type EditRequest, type EmailSend, type FileFilter, type FileImport, type FileUpdate, type FsOp, type Handoffs, type Identity, type IdentityCreate, type IdentityPatch, type ImageGeneration, type ImageRequest, type InboxCreate, type InstallApply, type InstallPreview, type LedgerFilter, type ListQuery, type McpSession, type McpSessionCreate, type MediaFilter, type MediaJob, type MediaModel, type MediaSkillBuild, type MediaSkillCreate, type MediaSkillFilter, type MediaToolConfig, type MeshRequest, type Method, type MobileAction, type MobileActionResult, type MobileDevice, type MobileDeviceCreate, type MobileInstallAppOutput, type MobileLiveView, type ModelSelection, type ModelSelectionPolicy, type ModelSelectionRequest, type ObjectListQuery, type Outcome, type OutcomeCreate, type OutcomeEvaluation, type PendingAction, type PhoneProvision, type PhoneTier, type PlaceTradingOrder, type Plan, type Post, type PostStatus, type ProxyBlock, type ProxyMessage, type ProxyMessageCreate, ResponseParseError, SOCIAL_PLATFORMS, SOCIAL_TEXT_PLATFORMS, SOCIAL_VISIBILITIES, type SaveBrowserContext, type SearchCampaignCreate, type Session, type SessionCreate, type SessionFilter, type SkillContent, type SocialDataRun, type SocialDataRunRequest, type SocialDataTool, type SocialDataToolDetail, type SocialDataToolSearch, type SocialPlatform, type SocialPostCreate, type SocialTextPlatform, type SocialVisibility, type SocialWorkspace, type SpeechCreate, type SpeechToSpeechCreate, type StockPhoto, type StockPhotoQuery, type StopReason, type StreamOptions, type ToolSettings, type TradingAccount, type TradingConnect, type TradingConnection, type TradingEnv, type TradingEnvQuery, type TradingOrder, type TradingOrdersQuery, type TradingPosition, type TradingQuote, type TradingQuotesQuery, type TranscriptionCreate, type UploadOptions, type UploadUrlOptions, type VaultCreate, type VettaClient, type VideoRequest, type WebToolConfig, type WebhookPatch, apiErrorFrom, createClient, filterQuery, resolveApp, send, withTool };
|
|
13298
|
+
export { type AdAccount, type AgentCreate, type AgentPatch, ApiError, type AppCreate, type AppOption, type AppPatch, type AuditFilter, type AuthConfig, type AuthConfigCreate, type AuthSession, type BrowserActionRequest, type BrowserCredential, type BrowserLogin, type BrowserOptionsInput, type BrowserSignup, type Build3dRequestInput, type Build3dResult, CONNECTION_AUTHS, type Call, type CardCreate, type CardPatch, type Character, type CharacterCreate, type CharacterFilter, type ClientConfig, type ClipCreate, type ClipFilter, type CloseTradingPosition, type ComputerCreate, type Connection, type ConnectionApp, type ConnectionAppDetail, type ConnectionAuth, type ConnectionField, type ConnectionStatus, type Connector, type CreateBrowserGrant, type CredentialCreate, type CrmActivityCreate, type CrmActivityUpdate, type CrmContactCreate, type CrmContactUpdate, DEFAULT_BASE_URL, type DataDomain, type DataRun, type DataRunRequest, type DataTool, type DataToolDetail, type DataToolSearch, type DbFilter, type DbOptions, type DbPage, type DeploymentCreate, type DeploymentPatch, type DomainCreate, type DomainPurchase, type EditJob, type EditRequest, type EmailSend, type FileFilter, type FileImport, type FileUpdate, type FsOp, type Handoffs, type Identity, type IdentityCreate, type IdentityPatch, type ImageGeneration, type ImageRequest, type InboxCreate, type InstallApply, type InstallPreview, type LedgerFilter, type ListQuery, type McpSession, type McpSessionCreate, type MediaFilter, type MediaJob, type MediaModel, type MediaSkillBuild, type MediaSkillCreate, type MediaSkillFilter, type MediaToolConfig, type MeshRequest, type Method, type MobileAction, type MobileActionResult, type MobileDevice, type MobileDeviceCreate, type MobileInstallAppOutput, type MobileLiveView, type ModelSelection, type ModelSelectionPolicy, type ModelSelectionRequest, type ObjectListQuery, type Outcome, type OutcomeCreate, type OutcomeEvaluation, type PendingAction, type PhoneProvision, type PhoneTier, type PlaceTradingOrder, type Plan, type Post, type PostStatus, type ProxyBlock, type ProxyMessage, type ProxyMessageCreate, ResponseParseError, SOCIAL_PLATFORMS, SOCIAL_TEXT_PLATFORMS, SOCIAL_VISIBILITIES, type SaveBrowserContext, type SearchCampaignCreate, type Session, type SessionCreate, type SessionFilter, type SkillContent, type SocialDataRun, type SocialDataRunRequest, type SocialDataTool, type SocialDataToolDetail, type SocialDataToolSearch, type SocialPlatform, type SocialPostCreate, type SocialTextPlatform, type SocialVisibility, type SocialWorkspace, type SpeechCreate, type SpeechToSpeechCreate, type StockPhoto, type StockPhotoQuery, type StopReason, type StreamOptions, type ToolSettings, type TradingAccount, type TradingConnect, type TradingConnection, type TradingEnv, type TradingEnvQuery, type TradingOrder, type TradingOrdersQuery, type TradingPosition, type TradingQuote, type TradingQuotesQuery, type TranscriptionCreate, type UploadOptions, type UploadUrlOptions, type VaultCreate, type VettaClient, type VideoRequest, type WebToolConfig, type WebhookPatch, apiErrorFrom, createClient, filterQuery, resolveApp, send, withTool };
|
package/dist/index.js
CHANGED
|
@@ -5496,6 +5496,7 @@ var CODE_BY_STATUS = {
|
|
|
5496
5496
|
var BLOCKED_AT_EDGE = "the request was blocked before it reached the API (HTTP 403); this can happen when a request body looks like SQL";
|
|
5497
5497
|
function unreadableMessage(status) {
|
|
5498
5498
|
if (status === 403) return BLOCKED_AT_EDGE;
|
|
5499
|
+
if (status === 401) return "HTTP 401: the API key was rejected and the response had no readable details; check the API key and that baseUrl points at the API";
|
|
5499
5500
|
return `HTTP ${status}: the error response had no readable details`;
|
|
5500
5501
|
}
|
|
5501
5502
|
function apiErrorFrom(response, text3) {
|
|
@@ -7733,9 +7734,11 @@ function withTool(tools, name, settings) {
|
|
|
7733
7734
|
}
|
|
7734
7735
|
|
|
7735
7736
|
// src/index.ts
|
|
7737
|
+
var DEFAULT_BASE_URL = "https://api.vetta.sh";
|
|
7736
7738
|
function createClient(options) {
|
|
7737
7739
|
const config = {
|
|
7738
7740
|
...options,
|
|
7741
|
+
baseUrl: (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "").replace(/\/v1$/, ""),
|
|
7739
7742
|
fetch: options.fetch ?? ((input, init) => globalThis.fetch(input, init)),
|
|
7740
7743
|
idempotencyKey: options.idempotencyKey ?? (() => crypto.randomUUID())
|
|
7741
7744
|
};
|
|
@@ -7794,6 +7797,7 @@ function createClient(options) {
|
|
|
7794
7797
|
export {
|
|
7795
7798
|
ApiError,
|
|
7796
7799
|
CONNECTION_AUTHS,
|
|
7800
|
+
DEFAULT_BASE_URL,
|
|
7797
7801
|
ResponseParseError,
|
|
7798
7802
|
SOCIAL_PLATFORMS,
|
|
7799
7803
|
SOCIAL_TEXT_PLATFORMS,
|