@idapt/browser-app-sdk 0.2.0 → 0.3.0
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/{chunk-KHPTFRT3.js → chunk-KMLUFF4F.js} +397 -393
- package/dist/chunk-KMLUFF4F.js.map +1 -0
- package/dist/{chunk-OKOO2JCS.js → chunk-QWNGAONE.js} +4 -4
- package/dist/{chunk-OKOO2JCS.js.map → chunk-QWNGAONE.js.map} +1 -1
- package/dist/{client-CZAWglsD.d.ts → client-CHsdQcgI.d.cts} +131 -109
- package/dist/{client-DjipcztO.d.cts → client-_Jvrbhz2.d.ts} +131 -109
- package/dist/{data-BuXXki1D.d.cts → data-DtOpB63U.d.cts} +56 -49
- package/dist/{data-BuXXki1D.d.ts → data-DtOpB63U.d.ts} +56 -49
- package/dist/index.cjs +396 -392
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/react.cjs +202 -179
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +2 -2
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-KHPTFRT3.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as IdaptClient } from './client-
|
|
2
|
-
export { A as AddMemberInput, a as AgentsApi, b as ApiKeysApi, c as AudioApi, B as BlobMeta,
|
|
3
|
-
import { H as HttpContext, C as CallOptions, A as AiGatewayProvider, a as AiGatewayUsageRow, V as VideoModel, b as VideoModelSearchResult, O as OperationHandle, c as VideoGenerationResult, D as DataStore, F as File, W as WriteOptions, d as DeletedResponse, e as DataStoreUploadInput, f as FileUploadResult, g as DataStoreCreateFolderInput, h as ConnectOptions } from './data-
|
|
4
|
-
export { i as Agent, j as AgentRun, k as AgentRunState, l as ApiKey, m as AppFolder, n as AudioModel, o as AudioModelCapabilities, p as AudioModelPricing, q as AuthMode,
|
|
1
|
+
import { I as IdaptClient } from './client-CHsdQcgI.cjs';
|
|
2
|
+
export { A as AddMemberInput, a as AgentsApi, b as ApiKeysApi, c as AudioApi, d as AutomationsApi, B as BlobMeta, e as BlobsApi, f as BlobsListOptions, C as COMMAND_BINDINGS, g as ChannelHandle, h as ChatsApi, i as CommandBinding, j as ComputersApi, k as CreateAgentInput, l as CreateApiKeyInput, m as CreateChatInput, n as CreateCollectionInput, o as CreateComputerInput, p as CreateComputerUserInput, q as CreateFolderInput, r as CreateFunctionInput, s as CreateInvitationInput, t as CreateInvitationResult, u as CreateProviderEndpointInput, v as CreateSecretInput, w as CreateShareInput, x as CreateUserEnvVarInput, y as CreateWorkspaceInput, D as DatastoreApi, z as DatastoreListOptions, E as DatastoreSetOptions, F as DeleteInvitationResult, G as DeletedResult, H as DeployFunctionFile, J as DeployFunctionInput, K as DocsApi, L as ExecCommandInput, M as ExecuteCommandOptions, N as FilesApi, O as FireAutomationInput, P as FunctionPermissionInput, Q as FunctionsApi, R as GenerateImageInput, S as GuideApi, T as GuideContent, U as IdaptClientDeps, V as ImagesApi, W as InstallStoreItemInput, X as InvokeFunctionInput, Y as ListAgentsQuery, Z as ListApiKeysQuery, _ as ListAutomationRunsQuery, $ as ListChatsQuery, a0 as ListComputersQuery, a1 as ListFilesQuery, a2 as ListFunctionRunsQuery, a3 as ListFunctionsQuery, a4 as ListMessagesQuery, a5 as ListNotificationsQuery, a6 as ListResult, a7 as ListRunsQuery, a8 as ListSharedWithMeQuery, a9 as ListSharesQuery, aa as ListUsageHistoryQuery, ab as ModelsApi, ac as NotificationAudience, ad as NotificationPreferenceUpdate, ae as NotificationsApi, af as PairComputerInput, ag as PairComputerResult, ah as PatchFileInput, ai as PatchPortInput, aj as PresenceEntry, ak as PresenceHeartbeatOptions, al as ProviderEndpointModelMappingInput, am as ProviderEndpointsApi, an as RealtimeApi, ao as RealtimeEvent, ap as RemoveShareInput, aq as RepromptMessageInput, ar as RotateApiKeyInput, as as RotateApiKeyResult, at as RunFileInput, au as RunFunctionInput, av as SearchApi, aw as SearchInput, ax as SearchStoreQuery, ay as SecretsApi, az as SendMessageInput, aA as SendNotificationInput, aB as SendNotificationResult, aC as SettingsApi, aD as SftpInput, aE as SftpListResult, aF as SftpOp, aG as SftpUploadInput, aH as SharingApi, aI as SpeakInput, aJ as SseEvent, aK as StoreApi, aL as SubscribeOptions, aM as SubscriptionApi, aN as TableQuery, aO as TablesApi, aP as TmuxInput, aQ as TmuxOp, aR as TranscribeInput, aS as UpdateAgentInput, aT as UpdateApiKeyInput, aU as UpdateChatInput, aV as UpdateCollectionInput, aW as UpdateComputerInput, aX as UpdateComputerUserInput, aY as UpdateFunctionInput, aZ as UpdateMemberInput, a_ as UpdateNotificationInput, a$ as UpdateProviderEndpointInput, b0 as UpdateSecretInput, b1 as UpdateSettingsInput, b2 as UpdateShareInput, b3 as UpdateWorkspaceInput, b4 as UploadInput, b5 as UserApi, b6 as V1CommandName, b7 as WebSearchApi, b8 as WebSearchInput, b9 as WorkspacesApi, ba as WritableMemberRole, bb as awaitOperation, bc as executeCommand, bd as getFileBlob, be as getFileText, bf as listFiles } from './client-CHsdQcgI.cjs';
|
|
3
|
+
import { H as HttpContext, C as CallOptions, A as AiGatewayProvider, a as AiGatewayUsageRow, V as VideoModel, b as VideoModelSearchResult, O as OperationHandle, c as VideoGenerationResult, D as DataStore, F as File, W as WriteOptions, d as DeletedResponse, e as DataStoreUploadInput, f as FileUploadResult, g as DataStoreCreateFolderInput, h as ConnectOptions } from './data-DtOpB63U.cjs';
|
|
4
|
+
export { i as Agent, j as AgentRun, k as AgentRunState, l as ApiKey, m as AppFolder, n as AudioModel, o as AudioModelCapabilities, p as AudioModelPricing, q as AuthMode, r as Automation, s as AutomationActionType, t as AutomationCostStats, u as AutomationRun, v as AutomationWithSecret, B as BlobObject, w as BundleReader, x as Chat, y as ChatCost, z as ChatCostByCallType, E as ChatStopResult, G as ClientMeta, I as Computer, J as ComputerEnvVar, K as ComputerExecResult, L as ComputerLoggingLevel, M as ComputerPort, N as ComputerServerInfo, P as ComputerState, Q as ComputerType, R as ComputerUser, S as CreateAutomationInput, T as DataCreateFolderInput, U as DataFolder, X as DataUploadInput, Y as DatastoreEntry, Z as EscalateRequest, _ as ExecutionBackend, $ as ExecutionRun, a0 as ExecutionRunStatus, a1 as FileList, a2 as FunctionDeployment, a3 as FunctionInvokeResult, a4 as FunctionResource, a5 as FunctionRun, a6 as HttpRequest, a7 as ImageGenerationResult, a8 as ImageModel, a9 as ImageModelPricing, aa as LLMModel, ab as LLMModelCapabilities, ac as LLMModelPricing, ad as ListEnvelope, ae as ManagedProviderPreset, af as Message, ag as MessageCostEntry, ah as MessageCosts, ai as ModelBase, aj as ModelModality, ak as Notification, al as NotificationConfig, am as NotificationPreference, an as NotificationSenderKind, ao as Pagination, ap as Permission, aq as ProviderEndpoint, ar as ProviderEndpointConnectionType, as as ProviderEndpointKind, at as ProviderEndpointModality, au as ProviderEndpointModelMapping, av as ProviderEndpointProtocol, aw as ProviderEndpointProviderKey, ax as ProviderEndpointRuntime, ay as ProviderEndpointTestResult, az as ProviderEndpointTransport, aA as ProviderEndpointVisibility, aB as QueryInput, aC as RemoteBundleReader, aD as RepromptResult, aE as RunCostMetrics, aF as RuntimeMode, aG as SearchResult, aH as Secret, aI as SecretWithValue, aJ as SendMessageResult, aK as Settings, aL as SftpEntry, aM as Share, aN as ShareDeletedResult, aO as SharePermission, aP as ShareResourceType, aQ as SharedWithMeItem, aR as SingleEnvelope, aS as SpeechResult, aT as SpeechStreamEvent, aU as StoreInstallResult, aV as StoreItem, aW as StoreItemType, aX as StoredCredential, aY as Subscription, aZ as SubscriptionPlan, a_ as TableCollection, a$ as TableRecord, b0 as TmuxWindow, b1 as TranscriptionResult, b2 as TranscriptionStreamEvent, b3 as TriggerType, b4 as TtsVoice, b5 as TtsVoiceGender, b6 as UpdateAutomationInput, b7 as UsageRecord, b8 as UsageSummary, b9 as User, ba as VideoModelCapabilities, bb as VideoModelPricing, bc as VideoModelRate, bd as VideoModelSearchItem, be as WebSearchHit, bf as WebSearchResponse, bg as Workspace, bh as WorkspaceInvitation, bi as WorkspaceMember, bj as WorkspaceMemberRole, bk as buildUrl, bl as request, bm as requestRaw } from './data-DtOpB63U.cjs';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as IdaptClient } from './client-
|
|
2
|
-
export { A as AddMemberInput, a as AgentsApi, b as ApiKeysApi, c as AudioApi, B as BlobMeta,
|
|
3
|
-
import { H as HttpContext, C as CallOptions, A as AiGatewayProvider, a as AiGatewayUsageRow, V as VideoModel, b as VideoModelSearchResult, O as OperationHandle, c as VideoGenerationResult, D as DataStore, F as File, W as WriteOptions, d as DeletedResponse, e as DataStoreUploadInput, f as FileUploadResult, g as DataStoreCreateFolderInput, h as ConnectOptions } from './data-
|
|
4
|
-
export { i as Agent, j as AgentRun, k as AgentRunState, l as ApiKey, m as AppFolder, n as AudioModel, o as AudioModelCapabilities, p as AudioModelPricing, q as AuthMode,
|
|
1
|
+
import { I as IdaptClient } from './client-_Jvrbhz2.js';
|
|
2
|
+
export { A as AddMemberInput, a as AgentsApi, b as ApiKeysApi, c as AudioApi, d as AutomationsApi, B as BlobMeta, e as BlobsApi, f as BlobsListOptions, C as COMMAND_BINDINGS, g as ChannelHandle, h as ChatsApi, i as CommandBinding, j as ComputersApi, k as CreateAgentInput, l as CreateApiKeyInput, m as CreateChatInput, n as CreateCollectionInput, o as CreateComputerInput, p as CreateComputerUserInput, q as CreateFolderInput, r as CreateFunctionInput, s as CreateInvitationInput, t as CreateInvitationResult, u as CreateProviderEndpointInput, v as CreateSecretInput, w as CreateShareInput, x as CreateUserEnvVarInput, y as CreateWorkspaceInput, D as DatastoreApi, z as DatastoreListOptions, E as DatastoreSetOptions, F as DeleteInvitationResult, G as DeletedResult, H as DeployFunctionFile, J as DeployFunctionInput, K as DocsApi, L as ExecCommandInput, M as ExecuteCommandOptions, N as FilesApi, O as FireAutomationInput, P as FunctionPermissionInput, Q as FunctionsApi, R as GenerateImageInput, S as GuideApi, T as GuideContent, U as IdaptClientDeps, V as ImagesApi, W as InstallStoreItemInput, X as InvokeFunctionInput, Y as ListAgentsQuery, Z as ListApiKeysQuery, _ as ListAutomationRunsQuery, $ as ListChatsQuery, a0 as ListComputersQuery, a1 as ListFilesQuery, a2 as ListFunctionRunsQuery, a3 as ListFunctionsQuery, a4 as ListMessagesQuery, a5 as ListNotificationsQuery, a6 as ListResult, a7 as ListRunsQuery, a8 as ListSharedWithMeQuery, a9 as ListSharesQuery, aa as ListUsageHistoryQuery, ab as ModelsApi, ac as NotificationAudience, ad as NotificationPreferenceUpdate, ae as NotificationsApi, af as PairComputerInput, ag as PairComputerResult, ah as PatchFileInput, ai as PatchPortInput, aj as PresenceEntry, ak as PresenceHeartbeatOptions, al as ProviderEndpointModelMappingInput, am as ProviderEndpointsApi, an as RealtimeApi, ao as RealtimeEvent, ap as RemoveShareInput, aq as RepromptMessageInput, ar as RotateApiKeyInput, as as RotateApiKeyResult, at as RunFileInput, au as RunFunctionInput, av as SearchApi, aw as SearchInput, ax as SearchStoreQuery, ay as SecretsApi, az as SendMessageInput, aA as SendNotificationInput, aB as SendNotificationResult, aC as SettingsApi, aD as SftpInput, aE as SftpListResult, aF as SftpOp, aG as SftpUploadInput, aH as SharingApi, aI as SpeakInput, aJ as SseEvent, aK as StoreApi, aL as SubscribeOptions, aM as SubscriptionApi, aN as TableQuery, aO as TablesApi, aP as TmuxInput, aQ as TmuxOp, aR as TranscribeInput, aS as UpdateAgentInput, aT as UpdateApiKeyInput, aU as UpdateChatInput, aV as UpdateCollectionInput, aW as UpdateComputerInput, aX as UpdateComputerUserInput, aY as UpdateFunctionInput, aZ as UpdateMemberInput, a_ as UpdateNotificationInput, a$ as UpdateProviderEndpointInput, b0 as UpdateSecretInput, b1 as UpdateSettingsInput, b2 as UpdateShareInput, b3 as UpdateWorkspaceInput, b4 as UploadInput, b5 as UserApi, b6 as V1CommandName, b7 as WebSearchApi, b8 as WebSearchInput, b9 as WorkspacesApi, ba as WritableMemberRole, bb as awaitOperation, bc as executeCommand, bd as getFileBlob, be as getFileText, bf as listFiles } from './client-_Jvrbhz2.js';
|
|
3
|
+
import { H as HttpContext, C as CallOptions, A as AiGatewayProvider, a as AiGatewayUsageRow, V as VideoModel, b as VideoModelSearchResult, O as OperationHandle, c as VideoGenerationResult, D as DataStore, F as File, W as WriteOptions, d as DeletedResponse, e as DataStoreUploadInput, f as FileUploadResult, g as DataStoreCreateFolderInput, h as ConnectOptions } from './data-DtOpB63U.js';
|
|
4
|
+
export { i as Agent, j as AgentRun, k as AgentRunState, l as ApiKey, m as AppFolder, n as AudioModel, o as AudioModelCapabilities, p as AudioModelPricing, q as AuthMode, r as Automation, s as AutomationActionType, t as AutomationCostStats, u as AutomationRun, v as AutomationWithSecret, B as BlobObject, w as BundleReader, x as Chat, y as ChatCost, z as ChatCostByCallType, E as ChatStopResult, G as ClientMeta, I as Computer, J as ComputerEnvVar, K as ComputerExecResult, L as ComputerLoggingLevel, M as ComputerPort, N as ComputerServerInfo, P as ComputerState, Q as ComputerType, R as ComputerUser, S as CreateAutomationInput, T as DataCreateFolderInput, U as DataFolder, X as DataUploadInput, Y as DatastoreEntry, Z as EscalateRequest, _ as ExecutionBackend, $ as ExecutionRun, a0 as ExecutionRunStatus, a1 as FileList, a2 as FunctionDeployment, a3 as FunctionInvokeResult, a4 as FunctionResource, a5 as FunctionRun, a6 as HttpRequest, a7 as ImageGenerationResult, a8 as ImageModel, a9 as ImageModelPricing, aa as LLMModel, ab as LLMModelCapabilities, ac as LLMModelPricing, ad as ListEnvelope, ae as ManagedProviderPreset, af as Message, ag as MessageCostEntry, ah as MessageCosts, ai as ModelBase, aj as ModelModality, ak as Notification, al as NotificationConfig, am as NotificationPreference, an as NotificationSenderKind, ao as Pagination, ap as Permission, aq as ProviderEndpoint, ar as ProviderEndpointConnectionType, as as ProviderEndpointKind, at as ProviderEndpointModality, au as ProviderEndpointModelMapping, av as ProviderEndpointProtocol, aw as ProviderEndpointProviderKey, ax as ProviderEndpointRuntime, ay as ProviderEndpointTestResult, az as ProviderEndpointTransport, aA as ProviderEndpointVisibility, aB as QueryInput, aC as RemoteBundleReader, aD as RepromptResult, aE as RunCostMetrics, aF as RuntimeMode, aG as SearchResult, aH as Secret, aI as SecretWithValue, aJ as SendMessageResult, aK as Settings, aL as SftpEntry, aM as Share, aN as ShareDeletedResult, aO as SharePermission, aP as ShareResourceType, aQ as SharedWithMeItem, aR as SingleEnvelope, aS as SpeechResult, aT as SpeechStreamEvent, aU as StoreInstallResult, aV as StoreItem, aW as StoreItemType, aX as StoredCredential, aY as Subscription, aZ as SubscriptionPlan, a_ as TableCollection, a$ as TableRecord, b0 as TmuxWindow, b1 as TranscriptionResult, b2 as TranscriptionStreamEvent, b3 as TriggerType, b4 as TtsVoice, b5 as TtsVoiceGender, b6 as UpdateAutomationInput, b7 as UsageRecord, b8 as UsageSummary, b9 as User, ba as VideoModelCapabilities, bb as VideoModelPricing, bc as VideoModelRate, bd as VideoModelSearchItem, be as WebSearchHit, bf as WebSearchResponse, bg as Workspace, bh as WorkspaceInvitation, bi as WorkspaceMember, bj as WorkspaceMemberRole, bk as buildUrl, bl as request, bm as requestRaw } from './data-DtOpB63U.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Idapt, IdaptClient, connect, detectAppId, getAppBaseUrl, makeConnect } from './chunk-
|
|
2
|
-
export { AgentsApi, AiGatewayApi, ApiKeysApi, AppFolder, AudioApi, AuthError, BlobsApi, COMMAND_BINDINGS, ChatsApi, ComputersApi, ConflictError, DataFolder, DatastoreApi, DocsApi, FilesApi, FunctionsApi, GuideApi, IdaptError, ImagesApi, InvalidRequestError, ModelsApi, NetworkError, NotFoundError, NotificationsApi, PermissionError, ProviderEndpointsApi, RateLimitError, RealtimeApi, RemoteBundleReader, RemoteDataStore, SearchApi, SecretsApi, ServerError, ServiceUnavailableError, SettingsApi, SharingApi, StoreApi, SubscriptionApi, TablesApi,
|
|
1
|
+
export { Idapt, IdaptClient, connect, detectAppId, getAppBaseUrl, makeConnect } from './chunk-QWNGAONE.js';
|
|
2
|
+
export { AgentsApi, AiGatewayApi, ApiKeysApi, AppFolder, AudioApi, AuthError, AutomationsApi, BlobsApi, COMMAND_BINDINGS, ChatsApi, ComputersApi, ConflictError, DataFolder, DatastoreApi, DocsApi, FilesApi, FunctionsApi, GuideApi, IdaptError, ImagesApi, InvalidRequestError, ModelsApi, NetworkError, NotFoundError, NotificationsApi, PermissionError, ProviderEndpointsApi, RateLimitError, RealtimeApi, RemoteBundleReader, RemoteDataStore, SearchApi, SecretsApi, ServerError, ServiceUnavailableError, SettingsApi, SharingApi, StoreApi, SubscriptionApi, TablesApi, UserApi, VERSION, VideosApi, WebSearchApi, WorkspacesApi, awaitOperation, buildUrl, errorFromStatus, executeCommand, getFileBlob, getFileText, listFiles, request, requestRaw } from './chunk-KMLUFF4F.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/react.cjs
CHANGED
|
@@ -665,6 +665,151 @@ function errorEvent(payload) {
|
|
|
665
665
|
return event;
|
|
666
666
|
}
|
|
667
667
|
|
|
668
|
+
// ../sdk/src/api/automations.ts
|
|
669
|
+
var AutomationsApi = class {
|
|
670
|
+
constructor(ctx) {
|
|
671
|
+
this.ctx = ctx;
|
|
672
|
+
}
|
|
673
|
+
// ---------------------------------------------------------------------------
|
|
674
|
+
// CRUD
|
|
675
|
+
// ---------------------------------------------------------------------------
|
|
676
|
+
async list(query = {}, opts = {}) {
|
|
677
|
+
const res = await request(this.ctx, {
|
|
678
|
+
method: "GET",
|
|
679
|
+
path: "/api/v1/automations",
|
|
680
|
+
query,
|
|
681
|
+
signal: opts.signal
|
|
682
|
+
});
|
|
683
|
+
return res.data;
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Create an automation. `workspace_id` is passed in the request BODY
|
|
687
|
+
* alongside the flat automation definition — it is not a query param. The request
|
|
688
|
+
* body is flat: every scheduling field (`cron_expression`, …) and every
|
|
689
|
+
* action field (`agent_id`, `prompt_template`, `function_id`, …) sits at the
|
|
690
|
+
* top level — there are no nested `trigger_config` / `action_config`
|
|
691
|
+
* objects any more.
|
|
692
|
+
*
|
|
693
|
+
* For a webhook automation the response additionally carries a one-time
|
|
694
|
+
* plaintext `secret` (use `AutomationWithSecret`); other automation types
|
|
695
|
+
* resolve to a plain `Automation`.
|
|
696
|
+
*/
|
|
697
|
+
async create(workspaceId, input, opts = {}) {
|
|
698
|
+
const res = await request(this.ctx, {
|
|
699
|
+
method: "POST",
|
|
700
|
+
path: "/api/v1/automations",
|
|
701
|
+
body: { workspace_id: workspaceId, ...input },
|
|
702
|
+
signal: opts.signal
|
|
703
|
+
});
|
|
704
|
+
return res.data;
|
|
705
|
+
}
|
|
706
|
+
async get(id, opts = {}) {
|
|
707
|
+
const res = await request(this.ctx, {
|
|
708
|
+
method: "GET",
|
|
709
|
+
path: `/api/v1/automations/${id}`,
|
|
710
|
+
signal: opts.signal
|
|
711
|
+
});
|
|
712
|
+
return res.data;
|
|
713
|
+
}
|
|
714
|
+
async update(id, input, opts = {}) {
|
|
715
|
+
const res = await request(this.ctx, {
|
|
716
|
+
method: "PATCH",
|
|
717
|
+
path: `/api/v1/automations/${id}`,
|
|
718
|
+
body: input,
|
|
719
|
+
signal: opts.signal
|
|
720
|
+
});
|
|
721
|
+
return res.data;
|
|
722
|
+
}
|
|
723
|
+
async delete(id, opts = {}) {
|
|
724
|
+
return request(this.ctx, {
|
|
725
|
+
method: "DELETE",
|
|
726
|
+
path: `/api/v1/automations/${id}`,
|
|
727
|
+
signal: opts.signal
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
async archive(id, opts = {}) {
|
|
731
|
+
const res = await request(this.ctx, {
|
|
732
|
+
method: "POST",
|
|
733
|
+
path: `/api/v1/automations/${id}/archive`,
|
|
734
|
+
signal: opts.signal
|
|
735
|
+
});
|
|
736
|
+
return res.data;
|
|
737
|
+
}
|
|
738
|
+
async unarchive(id, opts = {}) {
|
|
739
|
+
const res = await request(this.ctx, {
|
|
740
|
+
method: "POST",
|
|
741
|
+
path: `/api/v1/automations/${id}/unarchive`,
|
|
742
|
+
signal: opts.signal
|
|
743
|
+
});
|
|
744
|
+
return res.data;
|
|
745
|
+
}
|
|
746
|
+
// ---------------------------------------------------------------------------
|
|
747
|
+
// Fire + rotate-secret + runs
|
|
748
|
+
// ---------------------------------------------------------------------------
|
|
749
|
+
/**
|
|
750
|
+
* Fire an automation via its webhook secret. This endpoint does NOT use the
|
|
751
|
+
* client's `ap_` key — the bearer is the automation's secret — so we build a
|
|
752
|
+
* one-off HttpContext for it rather than mutating the shared one.
|
|
753
|
+
*
|
|
754
|
+
* Responds HTTP 202. The response identifies the fired automation via `id`
|
|
755
|
+
* only.
|
|
756
|
+
*/
|
|
757
|
+
async fire(id, input, opts = {}) {
|
|
758
|
+
const localCtx = {
|
|
759
|
+
apiUrl: this.ctx.apiUrl,
|
|
760
|
+
key: input.secret,
|
|
761
|
+
fetch: this.ctx.fetch
|
|
762
|
+
};
|
|
763
|
+
const res = await request(localCtx, {
|
|
764
|
+
method: "POST",
|
|
765
|
+
path: `/api/v1/automations/${id}/fire`,
|
|
766
|
+
body: input.body ?? {},
|
|
767
|
+
signal: opts.signal
|
|
768
|
+
});
|
|
769
|
+
return res.data;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Rotate the webhook secret. Returns the automation with a fresh one-time
|
|
773
|
+
* plaintext `secret` populated (`AutomationWithSecret`). The old secret
|
|
774
|
+
* immediately stops working.
|
|
775
|
+
*/
|
|
776
|
+
async rotateSecret(id, opts = {}) {
|
|
777
|
+
const res = await request(this.ctx, {
|
|
778
|
+
method: "POST",
|
|
779
|
+
path: `/api/v1/automations/${id}/rotate-secret`,
|
|
780
|
+
signal: opts.signal
|
|
781
|
+
});
|
|
782
|
+
return res.data;
|
|
783
|
+
}
|
|
784
|
+
/** Recent fires + their success/error outcome. */
|
|
785
|
+
async listRuns(id, query = {}, opts = {}) {
|
|
786
|
+
const res = await request(this.ctx, {
|
|
787
|
+
method: "GET",
|
|
788
|
+
path: `/api/v1/automations/${id}/runs`,
|
|
789
|
+
query,
|
|
790
|
+
signal: opts.signal
|
|
791
|
+
});
|
|
792
|
+
return res.data;
|
|
793
|
+
}
|
|
794
|
+
async getCostStats(id, opts = {}) {
|
|
795
|
+
const res = await request(this.ctx, {
|
|
796
|
+
method: "GET",
|
|
797
|
+
path: `/api/v1/automations/${id}/cost-stats`,
|
|
798
|
+
signal: opts.signal
|
|
799
|
+
});
|
|
800
|
+
return res.data;
|
|
801
|
+
}
|
|
802
|
+
async getCostStatsMap(query = {}, opts = {}) {
|
|
803
|
+
const res = await request(this.ctx, {
|
|
804
|
+
method: "GET",
|
|
805
|
+
path: "/api/v1/automations/cost-stats",
|
|
806
|
+
query,
|
|
807
|
+
signal: opts.signal
|
|
808
|
+
});
|
|
809
|
+
return res.data.by_id;
|
|
810
|
+
}
|
|
811
|
+
};
|
|
812
|
+
|
|
668
813
|
// ../sdk/src/api/blobs.ts
|
|
669
814
|
var enc = encodeURIComponent;
|
|
670
815
|
var BlobsApi = class {
|
|
@@ -1493,59 +1638,85 @@ var ComputersApi = class {
|
|
|
1493
1638
|
return res.data;
|
|
1494
1639
|
}
|
|
1495
1640
|
// ---------------------------------------------------------------------------
|
|
1496
|
-
// Workspace
|
|
1641
|
+
// Workspace exposures (expose an actor-owned machine into a workspace) +
|
|
1642
|
+
// ownership transfer
|
|
1497
1643
|
// ---------------------------------------------------------------------------
|
|
1498
1644
|
/**
|
|
1499
|
-
*
|
|
1500
|
-
*
|
|
1501
|
-
*
|
|
1645
|
+
* Expose an actor-owned machine INTO a workspace (Layer 2) with a
|
|
1646
|
+
* per-capability grant, so that workspace's members can use it. Requires
|
|
1647
|
+
* machine-admin and membership of the target workspace. Rejects a duplicate
|
|
1648
|
+
* exposure. (CLI verb: `computer add-exposure` — the bare `expose`/`unexpose`
|
|
1649
|
+
* verbs are the tunnel port commands.)
|
|
1502
1650
|
*/
|
|
1503
|
-
async
|
|
1504
|
-
const res = await request(
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1651
|
+
async expose(id, input, opts = {}) {
|
|
1652
|
+
const res = await request(
|
|
1653
|
+
this.ctx,
|
|
1654
|
+
{
|
|
1655
|
+
method: "POST",
|
|
1656
|
+
path: `/api/v1/computers/${id}/expose`,
|
|
1657
|
+
body: input,
|
|
1658
|
+
signal: opts.signal
|
|
1659
|
+
}
|
|
1660
|
+
);
|
|
1661
|
+
return res.data.exposure;
|
|
1510
1662
|
}
|
|
1511
1663
|
/**
|
|
1512
|
-
*
|
|
1513
|
-
*
|
|
1514
|
-
*
|
|
1515
|
-
* membership of the target. Rejects the home workspace and duplicates.
|
|
1664
|
+
* Replace the capability grant on an existing exposure. `workspaceId` is the
|
|
1665
|
+
* exposed workspace's `ws_…` resourceId. Requires machine-admin.
|
|
1666
|
+
* (CLI verb: `computer update-exposure`.)
|
|
1516
1667
|
*/
|
|
1517
|
-
async
|
|
1668
|
+
async updateExposure(id, workspaceId, capabilities, opts = {}) {
|
|
1518
1669
|
const res = await request(
|
|
1519
1670
|
this.ctx,
|
|
1520
1671
|
{
|
|
1521
|
-
method: "
|
|
1522
|
-
path: `/api/v1/computers/${id}/
|
|
1523
|
-
body: {
|
|
1672
|
+
method: "PATCH",
|
|
1673
|
+
path: `/api/v1/computers/${id}/expose/${workspaceId}`,
|
|
1674
|
+
body: { capabilities },
|
|
1524
1675
|
signal: opts.signal
|
|
1525
1676
|
}
|
|
1526
1677
|
);
|
|
1527
|
-
return res.data.
|
|
1678
|
+
return res.data.exposure;
|
|
1528
1679
|
}
|
|
1529
1680
|
/**
|
|
1530
|
-
* Stop
|
|
1531
|
-
*
|
|
1532
|
-
*
|
|
1681
|
+
* Stop exposing a machine into a workspace. `workspaceId` is the exposed
|
|
1682
|
+
* workspace's `ws_…` resourceId. Allowed for machine-admin OR an admin of the
|
|
1683
|
+
* exposed workspace. Idempotent. (CLI verb: `computer remove-exposure`.)
|
|
1533
1684
|
*/
|
|
1534
|
-
async
|
|
1535
|
-
const res = await request(
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1685
|
+
async unexpose(id, workspaceId, opts = {}) {
|
|
1686
|
+
const res = await request(
|
|
1687
|
+
this.ctx,
|
|
1688
|
+
{
|
|
1689
|
+
method: "DELETE",
|
|
1690
|
+
path: `/api/v1/computers/${id}/expose/${workspaceId}`,
|
|
1691
|
+
signal: opts.signal
|
|
1692
|
+
}
|
|
1693
|
+
);
|
|
1540
1694
|
return res.data;
|
|
1541
1695
|
}
|
|
1696
|
+
/**
|
|
1697
|
+
* Transfer an actor-owned machine to a new owner (self, or an org the caller
|
|
1698
|
+
* administers). `owner` is the target profile's resourceId; existing workspace
|
|
1699
|
+
* exposures are kept. Requires machine-admin. (CLI verb: `computer transfer`.)
|
|
1700
|
+
*/
|
|
1701
|
+
async transfer(id, owner, opts = {}) {
|
|
1702
|
+
const res = await request(
|
|
1703
|
+
this.ctx,
|
|
1704
|
+
{
|
|
1705
|
+
method: "POST",
|
|
1706
|
+
path: `/api/v1/computers/${id}/transfer`,
|
|
1707
|
+
body: { owner },
|
|
1708
|
+
signal: opts.signal
|
|
1709
|
+
}
|
|
1710
|
+
);
|
|
1711
|
+
return res.data.computer;
|
|
1712
|
+
}
|
|
1542
1713
|
// ---------------------------------------------------------------------------
|
|
1543
1714
|
// Pair-token redemption (daemon bootstrap)
|
|
1544
1715
|
// ---------------------------------------------------------------------------
|
|
1545
1716
|
/**
|
|
1546
1717
|
* Redeem a one-time pair token for a long-lived computer identity. The
|
|
1547
1718
|
* token itself is the auth — we swap the bearer for the token on this
|
|
1548
|
-
* call only (same pattern as `
|
|
1719
|
+
* call only (same pattern as `automations.fire`).
|
|
1549
1720
|
*
|
|
1550
1721
|
* Used by `idapt up --token` to bootstrap a daemon. The request body is
|
|
1551
1722
|
* snake_case; the response is wrapped in the standard `{data:{…}}`
|
|
@@ -2772,154 +2943,6 @@ var TablesApi = class {
|
|
|
2772
2943
|
}
|
|
2773
2944
|
};
|
|
2774
2945
|
|
|
2775
|
-
// ../sdk/src/api/triggers.ts
|
|
2776
|
-
var TriggersApi = class {
|
|
2777
|
-
constructor(ctx) {
|
|
2778
|
-
this.ctx = ctx;
|
|
2779
|
-
}
|
|
2780
|
-
// ---------------------------------------------------------------------------
|
|
2781
|
-
// CRUD
|
|
2782
|
-
// ---------------------------------------------------------------------------
|
|
2783
|
-
async list(query = {}, opts = {}) {
|
|
2784
|
-
const res = await request(this.ctx, {
|
|
2785
|
-
method: "GET",
|
|
2786
|
-
path: "/api/v1/triggers",
|
|
2787
|
-
query,
|
|
2788
|
-
signal: opts.signal
|
|
2789
|
-
});
|
|
2790
|
-
return res.data;
|
|
2791
|
-
}
|
|
2792
|
-
/**
|
|
2793
|
-
* Create a trigger. `workspace_id` is passed in the request BODY (alongside
|
|
2794
|
-
* the flat trigger definition) — it is not a query param. The request
|
|
2795
|
-
* body is flat: every scheduling field (`cron_expression`, …) and every
|
|
2796
|
-
* action field (`agent_id`, `prompt_template`, `file_id`, …) sits at the
|
|
2797
|
-
* top level — there are no nested `trigger_config` / `action_config`
|
|
2798
|
-
* objects any more.
|
|
2799
|
-
*
|
|
2800
|
-
* For a `webhook` trigger the response additionally carries a one-time
|
|
2801
|
-
* plaintext `secret` (use `TriggerWithSecret`); other trigger types
|
|
2802
|
-
* resolve to a plain `Trigger`.
|
|
2803
|
-
*/
|
|
2804
|
-
async create(workspaceId, input, opts = {}) {
|
|
2805
|
-
const res = await request(
|
|
2806
|
-
this.ctx,
|
|
2807
|
-
{
|
|
2808
|
-
method: "POST",
|
|
2809
|
-
path: "/api/v1/triggers",
|
|
2810
|
-
body: { workspace_id: workspaceId, ...input },
|
|
2811
|
-
signal: opts.signal
|
|
2812
|
-
}
|
|
2813
|
-
);
|
|
2814
|
-
return res.data;
|
|
2815
|
-
}
|
|
2816
|
-
async get(id, opts = {}) {
|
|
2817
|
-
const res = await request(this.ctx, {
|
|
2818
|
-
method: "GET",
|
|
2819
|
-
path: `/api/v1/triggers/${id}`,
|
|
2820
|
-
signal: opts.signal
|
|
2821
|
-
});
|
|
2822
|
-
return res.data;
|
|
2823
|
-
}
|
|
2824
|
-
async update(id, input, opts = {}) {
|
|
2825
|
-
const res = await request(this.ctx, {
|
|
2826
|
-
method: "PATCH",
|
|
2827
|
-
path: `/api/v1/triggers/${id}`,
|
|
2828
|
-
body: input,
|
|
2829
|
-
signal: opts.signal
|
|
2830
|
-
});
|
|
2831
|
-
return res.data;
|
|
2832
|
-
}
|
|
2833
|
-
async delete(id, opts = {}) {
|
|
2834
|
-
return request(this.ctx, {
|
|
2835
|
-
method: "DELETE",
|
|
2836
|
-
path: `/api/v1/triggers/${id}`,
|
|
2837
|
-
signal: opts.signal
|
|
2838
|
-
});
|
|
2839
|
-
}
|
|
2840
|
-
async archive(id, opts = {}) {
|
|
2841
|
-
const res = await request(this.ctx, {
|
|
2842
|
-
method: "POST",
|
|
2843
|
-
path: `/api/v1/triggers/${id}/archive`,
|
|
2844
|
-
signal: opts.signal
|
|
2845
|
-
});
|
|
2846
|
-
return res.data;
|
|
2847
|
-
}
|
|
2848
|
-
async unarchive(id, opts = {}) {
|
|
2849
|
-
const res = await request(this.ctx, {
|
|
2850
|
-
method: "POST",
|
|
2851
|
-
path: `/api/v1/triggers/${id}/unarchive`,
|
|
2852
|
-
signal: opts.signal
|
|
2853
|
-
});
|
|
2854
|
-
return res.data;
|
|
2855
|
-
}
|
|
2856
|
-
// ---------------------------------------------------------------------------
|
|
2857
|
-
// Fire + rotate-secret + runs
|
|
2858
|
-
// ---------------------------------------------------------------------------
|
|
2859
|
-
/**
|
|
2860
|
-
* Fire a trigger via its webhook secret. This endpoint does NOT use the
|
|
2861
|
-
* client's `ap_` key — the bearer is the trigger's secret — so we build a
|
|
2862
|
-
* one-off HttpContext for it rather than mutating the shared one.
|
|
2863
|
-
*
|
|
2864
|
-
* Responds HTTP 202. The response identifies the fired trigger via `id`
|
|
2865
|
-
* only.
|
|
2866
|
-
*/
|
|
2867
|
-
async fire(id, input, opts = {}) {
|
|
2868
|
-
const localCtx = {
|
|
2869
|
-
apiUrl: this.ctx.apiUrl,
|
|
2870
|
-
key: input.secret,
|
|
2871
|
-
fetch: this.ctx.fetch
|
|
2872
|
-
};
|
|
2873
|
-
const res = await request(localCtx, {
|
|
2874
|
-
method: "POST",
|
|
2875
|
-
path: `/api/v1/triggers/${id}/fire`,
|
|
2876
|
-
body: input.body ?? {},
|
|
2877
|
-
signal: opts.signal
|
|
2878
|
-
});
|
|
2879
|
-
return res.data;
|
|
2880
|
-
}
|
|
2881
|
-
/**
|
|
2882
|
-
* Rotate the webhook secret. Returns the trigger with a fresh one-time
|
|
2883
|
-
* plaintext `secret` populated (`TriggerWithSecret`). The old secret
|
|
2884
|
-
* immediately stops working.
|
|
2885
|
-
*/
|
|
2886
|
-
async rotateSecret(id, opts = {}) {
|
|
2887
|
-
const res = await request(this.ctx, {
|
|
2888
|
-
method: "POST",
|
|
2889
|
-
path: `/api/v1/triggers/${id}/rotate-secret`,
|
|
2890
|
-
signal: opts.signal
|
|
2891
|
-
});
|
|
2892
|
-
return res.data;
|
|
2893
|
-
}
|
|
2894
|
-
/** Recent fires + their success/error outcome. */
|
|
2895
|
-
async listRuns(id, query = {}, opts = {}) {
|
|
2896
|
-
const res = await request(this.ctx, {
|
|
2897
|
-
method: "GET",
|
|
2898
|
-
path: `/api/v1/triggers/${id}/runs`,
|
|
2899
|
-
query,
|
|
2900
|
-
signal: opts.signal
|
|
2901
|
-
});
|
|
2902
|
-
return res.data;
|
|
2903
|
-
}
|
|
2904
|
-
async getCostStats(id, opts = {}) {
|
|
2905
|
-
const res = await request(this.ctx, {
|
|
2906
|
-
method: "GET",
|
|
2907
|
-
path: `/api/v1/triggers/${id}/cost-stats`,
|
|
2908
|
-
signal: opts.signal
|
|
2909
|
-
});
|
|
2910
|
-
return res.data;
|
|
2911
|
-
}
|
|
2912
|
-
async getCostStatsMap(query = {}, opts = {}) {
|
|
2913
|
-
const res = await request(this.ctx, {
|
|
2914
|
-
method: "GET",
|
|
2915
|
-
path: "/api/v1/triggers/cost-stats",
|
|
2916
|
-
query,
|
|
2917
|
-
signal: opts.signal
|
|
2918
|
-
});
|
|
2919
|
-
return res.data.by_id;
|
|
2920
|
-
}
|
|
2921
|
-
};
|
|
2922
|
-
|
|
2923
2946
|
// ../sdk/src/api/user.ts
|
|
2924
2947
|
var UserApi = class {
|
|
2925
2948
|
constructor(ctx) {
|
|
@@ -3616,7 +3639,7 @@ var IdaptClient2 = class {
|
|
|
3616
3639
|
this.agents = new AgentsApi(v1Ctx);
|
|
3617
3640
|
this.chats = new ChatsApi(v1Ctx);
|
|
3618
3641
|
this.workspaces = new WorkspacesApi(v1Ctx);
|
|
3619
|
-
this.
|
|
3642
|
+
this.automations = new AutomationsApi(v1Ctx);
|
|
3620
3643
|
this.computers = new ComputersApi(v1Ctx);
|
|
3621
3644
|
this.secrets = new SecretsApi(v1Ctx);
|
|
3622
3645
|
this.kv = new DatastoreApi(v1Ctx);
|