@stack0/sdk 0.5.8 → 0.5.9

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.mts CHANGED
@@ -1,14 +1,15 @@
1
1
  import { Mail } from './mail/index.mjs';
2
2
  export { AddContactToSequenceRequest, AddContactsToAudienceRequest, AddContactsToAudienceResponse, AddDomainRequest, AddDomainResponse, ArchiveSequenceResponse, Attachment, Audience, AudienceContact, Audiences, BatchTrackEventsRequest, BatchTrackEventsResponse, Campaign, CampaignStatsResponse, CampaignStatus, Campaigns, CancelCampaignResponse, CancelEmailResponse, ConnectionType, ContactStatus, Contacts, CreateAudienceRequest, CreateCampaignRequest, CreateConnectionRequest, CreateContactRequest, CreateEventRequest, CreateNodeRequest, CreateSequenceRequest, CreateTemplateRequest, DeleteAudienceResponse, DeleteCampaignResponse, DeleteConnectionResponse, DeleteContactResponse, DeleteDomainResponse, DeleteEventResponse, DeleteNodeResponse, DeleteSequenceResponse, DeleteTemplateResponse, DnsRecord, Domain, DomainStatus, Domains, Email, EmailAddress, EmailAnalyticsResponse, EmailRecipient, EmailStatus, EventAnalyticsResponse, EventOccurrence, EventPropertiesSchema, EventProperty, Events, GetDnsRecordsResponse, GetEmailResponse, HourlyAnalyticsDataPoint, HourlyAnalyticsResponse, ImportContactsRequest, ImportContactsResponse, ListAudienceContactsRequest, ListAudienceContactsResponse, ListAudiencesRequest, ListAudiencesResponse, ListCampaignsRequest, ListCampaignsResponse, ListContactsRequest, ListContactsResponse, ListDomainsRequest, ListDomainsResponse, ListEmailsRequest, ListEmailsResponse, ListEventOccurrencesRequest, ListEventOccurrencesResponse, ListEventsRequest, ListEventsResponse, ListSendersRequest, ListSendersResponse, ListSequenceEntriesRequest, ListSequenceEntriesResponse, ListSequencesRequest, ListSequencesResponse, ListTemplatesRequest, ListTemplatesResponse, MailContact, MailEvent, PauseCampaignResponse, PauseSequenceResponse, PreviewTemplateRequest, PreviewTemplateResponse, PublishSequenceResponse, RemoveContactFromSequenceRequest, RemoveContactFromSequenceResponse, RemoveContactsFromAudienceRequest, RemoveContactsFromAudienceResponse, ResendEmailResponse, ResumeSequenceResponse, SendBatchEmailRequest, SendBatchEmailResponse, SendBroadcastEmailRequest, SendBroadcastEmailResponse, SendCampaignRequest, SendCampaignResponse, SendEmailRequest, SendEmailResponse, Sender, Sequence, SequenceAnalyticsResponse, SequenceConnection, SequenceEntry, SequenceEntryStatus, SequenceNode, SequenceNodeType, SequenceStatus, SequenceTriggerFrequency, SequenceTriggerType, SequenceWithNodes, Sequences, SetDefaultDomainResponse, SetNodeBranchRequest, SetNodeEmailRequest, SetNodeExperimentRequest, SetNodeFilterRequest, SetNodeTimerRequest, Template, Templates, TimeSeriesAnalyticsRequest, TimeSeriesAnalyticsResponse, TimeSeriesDataPoint, TrackEventRequest, TrackEventResponse, UpdateAudienceRequest, UpdateCampaignRequest, UpdateContactRequest, UpdateEventRequest, UpdateNodePositionRequest, UpdateNodeRequest, UpdateSequenceRequest, UpdateTemplateRequest, VerifyDomainResponse } from './mail/index.mjs';
3
3
  import { CDN } from './cdn/index.mjs';
4
- export { Asset, AssetStatus, AssetType, AudioTrackInput, BundleDownloadUrlRequest, BundleDownloadUrlResponse, BundleStatus, CancelMergeJobRequest, CdnEnvironment, CdnStorageBreakdownItem, CdnStorageBreakdownRequest, CdnStorageBreakdownResponse, CdnUsageDataPoint, CdnUsageHistoryRequest, CdnUsageHistoryResponse, CdnUsageRequest, CdnUsageResponse, ConfirmUploadRequest, ConfirmUploadResponse, CreateBundleRequest, CreateBundleResponse, CreateFolderRequest, CreateMergeJobRequest, DeleteAssetRequest, DeleteAssetsRequest, DeleteAssetsResponse, DownloadBundle, ExtractAudioRequest, ExtractAudioResponse, Folder, FolderListItem, FolderTreeNode, GenerateGifRequest, GetAssetRequest, GetFolderByPathRequest, GetFolderRequest, GetFolderTreeRequest, GetMergeJobRequest, GifStatus, ImageWatermarkConfig, ImageWatermarkPosition, ImageWatermarkSizingMode, ListAssetsRequest, ListAssetsResponse, ListBundlesRequest, ListBundlesResponse, ListFoldersRequest, ListFoldersResponse, ListGifsRequest, ListJobsRequest, ListJobsResponse, ListMergeJobsRequest, ListMergeJobsResponse, ListPrivateFilesRequest, ListPrivateFilesResponse, ListThumbnailsRequest, ListThumbnailsResponse, MergeInputItem, MergeJob, MergeJobWithOutput, MergeOutputConfig, MergeOutputFormat, MergeQuality, MergeStatus, MoveAssetsRequest, MoveAssetsResponse, MoveFolderRequest, MoveFolderResponse, MovePrivateFilesRequest, MovePrivateFilesResponse, PrivateDownloadUrlRequest, PrivateDownloadUrlResponse, PrivateFile, PrivateFileStatus, PrivateUploadUrlRequest, PrivateUploadUrlResponse, RegenerateThumbnailRequest, RegenerateThumbnailResponse, StreamingUrls, TextOverlay, TextOverlayShadow, TextOverlayStroke, ThumbnailRequest, ThumbnailResponse, TranscodeJob, TranscodeVideoRequest, TranscodingStatus, TransformOptions, TrimOptions, UpdateAssetRequest, UpdateFolderRequest, UpdatePrivateFileRequest, UploadUrlRequest, UploadUrlResponse, VideoCodec, VideoGif, VideoOutputFormat, VideoQuality, VideoThumbnail, VideoVariant, WatermarkOptions } from './cdn/index.mjs';
4
+ export { Asset, AssetStatus, AssetType, AudioTrackInput, BundleDownloadUrlRequest, BundleDownloadUrlResponse, BundleStatus, CancelImportResponse, CancelMergeJobRequest, CdnEnvironment, CdnStorageBreakdownItem, CdnStorageBreakdownRequest, CdnStorageBreakdownResponse, CdnUsageDataPoint, CdnUsageHistoryRequest, CdnUsageHistoryResponse, CdnUsageRequest, CdnUsageResponse, ConfirmUploadRequest, ConfirmUploadResponse, CreateBundleRequest, CreateBundleResponse, CreateFolderRequest, CreateImportRequest, CreateImportResponse, CreateMergeJobRequest, DeleteAssetRequest, DeleteAssetsRequest, DeleteAssetsResponse, DownloadBundle, ExtractAudioRequest, ExtractAudioResponse, Folder, FolderListItem, FolderTreeNode, GenerateGifRequest, GetAssetRequest, GetFolderByPathRequest, GetFolderRequest, GetFolderTreeRequest, GetMergeJobRequest, GifStatus, ImageWatermarkConfig, ImageWatermarkPosition, ImageWatermarkSizingMode, ImportAuthType, ImportError, ImportFile, ImportFileStatus, ImportJob, ImportJobStatus, ImportJobSummary, ImportPathMode, ListAssetsRequest, ListAssetsResponse, ListBundlesRequest, ListBundlesResponse, ListFoldersRequest, ListFoldersResponse, ListGifsRequest, ListImportFilesRequest, ListImportFilesResponse, ListImportsRequest, ListImportsResponse, ListJobsRequest, ListJobsResponse, ListMergeJobsRequest, ListMergeJobsResponse, ListPrivateFilesRequest, ListPrivateFilesResponse, ListThumbnailsRequest, ListThumbnailsResponse, MergeInputItem, MergeJob, MergeJobWithOutput, MergeOutputConfig, MergeOutputFormat, MergeQuality, MergeStatus, MoveAssetsRequest, MoveAssetsResponse, MoveFolderRequest, MoveFolderResponse, MovePrivateFilesRequest, MovePrivateFilesResponse, PrivateDownloadUrlRequest, PrivateDownloadUrlResponse, PrivateFile, PrivateFileStatus, PrivateUploadUrlRequest, PrivateUploadUrlResponse, RegenerateThumbnailRequest, RegenerateThumbnailResponse, RetryImportResponse, StreamingUrls, TextOverlay, TextOverlayShadow, TextOverlayStroke, ThumbnailRequest, ThumbnailResponse, TranscodeJob, TranscodeVideoRequest, TranscodingStatus, TransformOptions, TrimOptions, UpdateAssetRequest, UpdateFolderRequest, UpdatePrivateFileRequest, UploadFromUrlRequest, UploadUrlRequest, UploadUrlResponse, VideoCodec, VideoGif, VideoOutputFormat, VideoQuality, VideoThumbnail, VideoVariant, WatermarkOptions } from './cdn/index.mjs';
5
5
  import { Screenshots } from './screenshots/index.mjs';
6
6
  export { BatchScreenshotJob, Clip, CreateBatchScreenshotsRequest, CreateScreenshotRequest, CreateScreenshotResponse, CreateScreenshotScheduleRequest, DeviceType, GetScreenshotRequest, ListScreenshotsRequest, ListScreenshotsResponse, ResourceType, Screenshot, ScreenshotBatchJobsResponse, ScreenshotFormat, ScreenshotSchedule, ScreenshotSchedulesResponse, ScreenshotStatus, UpdateScreenshotScheduleRequest } from './screenshots/index.mjs';
7
7
  import { Extraction } from './extraction/index.mjs';
8
8
  export { BatchExtractionJob, CreateBatchExtractionsRequest, CreateExtractionRequest, CreateExtractionResponse, CreateExtractionScheduleRequest, DailyUsageItem, ExtractionBatchJobsResponse, ExtractionMode, ExtractionResult, ExtractionSchedule, ExtractionSchedulesResponse, ExtractionStatus, ExtractionUsage, GetDailyUsageResponse, GetExtractionRequest, GetUsageRequest, ListExtractionsRequest, ListExtractionsResponse, PageMetadata, UpdateExtractionScheduleRequest } from './extraction/index.mjs';
9
9
  import { Webdata } from './webdata/index.mjs';
10
10
  import { H as HttpClient, a as HttpClientConfig } from './http-client-Cgie_Rv6.mjs';
11
- export { B as BatchJobStatus, C as CreateBatchResponse, e as CreateScheduleResponse, E as Environment, G as GetBatchJobRequest, c as GetScheduleRequest, L as ListBatchJobsRequest, d as ListSchedulesRequest, P as PaginatedRequest, a as PaginatedResponse, b as ScheduleFrequency, S as Stack0Error } from './shared-types-CjKSP5Xc.mjs';
11
+ import { E as Environment$1 } from './shared-types-CjKSP5Xc.mjs';
12
+ export { B as BatchJobStatus, C as CreateBatchResponse, e as CreateScheduleResponse, G as GetBatchJobRequest, c as GetScheduleRequest, L as ListBatchJobsRequest, d as ListSchedulesRequest, P as PaginatedRequest, a as PaginatedResponse, b as ScheduleFrequency, S as Stack0Error } from './shared-types-CjKSP5Xc.mjs';
12
13
 
13
14
  /**
14
15
  * Stack0 Integrations SDK Types
@@ -1665,6 +1666,742 @@ declare class Marketing {
1665
1666
  private convertMarketingUsageDates;
1666
1667
  }
1667
1668
 
1669
+ /**
1670
+ * Stack0 Workflows Types
1671
+ * AI workflow orchestration and execution
1672
+ */
1673
+ type Environment = "sandbox" | "production";
1674
+ type Provider = "anthropic" | "openai" | "gemini" | "replicate" | "stack0";
1675
+ type StepType = "llm" | "image" | "video" | "audio" | "code" | "http" | "transform" | "condition" | "loop";
1676
+ type ResponseFormat = "text" | "json";
1677
+ type RunStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
1678
+ type StepRunStatus = "pending" | "running" | "completed" | "failed" | "skipped" | "cancelled";
1679
+ interface StepConfig {
1680
+ prompt?: string;
1681
+ systemPrompt?: string;
1682
+ temperature?: number;
1683
+ maxTokens?: number;
1684
+ responseFormat?: ResponseFormat;
1685
+ imageInputVariable?: string;
1686
+ schema?: Record<string, unknown>;
1687
+ width?: number;
1688
+ height?: number;
1689
+ steps?: number;
1690
+ url?: string;
1691
+ method?: "GET" | "POST" | "PUT" | "DELETE";
1692
+ headers?: Record<string, string>;
1693
+ body?: string;
1694
+ iterateOver?: string;
1695
+ itemVariable?: string;
1696
+ condition?: string;
1697
+ }
1698
+ interface RetryConfig {
1699
+ maxAttempts: number;
1700
+ backoffMs: number;
1701
+ }
1702
+ interface StepDefinition {
1703
+ id: string;
1704
+ name: string;
1705
+ type: StepType;
1706
+ provider: Provider;
1707
+ model: string;
1708
+ config: StepConfig & {
1709
+ subSteps?: StepDefinition[];
1710
+ thenSteps?: StepDefinition[];
1711
+ elseSteps?: StepDefinition[];
1712
+ };
1713
+ dependsOn?: string[];
1714
+ outputVariable?: string;
1715
+ retryConfig?: RetryConfig;
1716
+ }
1717
+ interface VariableDefinition {
1718
+ name: string;
1719
+ type: "string" | "number" | "boolean" | "array" | "object" | "image";
1720
+ required: boolean;
1721
+ default?: unknown;
1722
+ description?: string;
1723
+ }
1724
+ interface Workflow {
1725
+ id: string;
1726
+ slug: string;
1727
+ name: string;
1728
+ description: string | null;
1729
+ steps: StepDefinition[];
1730
+ variables: VariableDefinition[];
1731
+ isActive: boolean;
1732
+ version: number;
1733
+ environment: Environment;
1734
+ createdAt: Date;
1735
+ updatedAt: Date;
1736
+ }
1737
+ interface StepState {
1738
+ status: StepRunStatus;
1739
+ startedAt?: Date;
1740
+ completedAt?: Date;
1741
+ output?: unknown;
1742
+ error?: string;
1743
+ attempts: number;
1744
+ }
1745
+ interface WorkflowRun {
1746
+ id: string;
1747
+ workflowId: string;
1748
+ status: RunStatus;
1749
+ variables: Record<string, unknown>;
1750
+ metadata: Record<string, unknown> | null;
1751
+ currentStepId: string | null;
1752
+ stepStates: Record<string, StepState>;
1753
+ output: Record<string, unknown> | null;
1754
+ error: string | null;
1755
+ totalSteps: number;
1756
+ completedSteps: number;
1757
+ startedAt: Date | null;
1758
+ completedAt: Date | null;
1759
+ totalDurationMs: number | null;
1760
+ creditsUsed: number;
1761
+ environment: Environment;
1762
+ createdAt: Date;
1763
+ }
1764
+ interface CreateWorkflowRequest {
1765
+ projectSlug?: string;
1766
+ environment?: Environment;
1767
+ slug: string;
1768
+ name: string;
1769
+ description?: string;
1770
+ steps: StepDefinition[];
1771
+ variables?: VariableDefinition[];
1772
+ }
1773
+ interface CreateWorkflowResponse {
1774
+ id: string;
1775
+ slug: string;
1776
+ name: string;
1777
+ version: number;
1778
+ }
1779
+ interface UpdateWorkflowRequest {
1780
+ id: string;
1781
+ projectSlug?: string;
1782
+ name?: string;
1783
+ description?: string;
1784
+ steps?: StepDefinition[];
1785
+ variables?: VariableDefinition[];
1786
+ isActive?: boolean;
1787
+ }
1788
+ interface GetWorkflowRequest {
1789
+ id?: string;
1790
+ slug?: string;
1791
+ projectSlug?: string;
1792
+ environment?: Environment;
1793
+ }
1794
+ interface ListWorkflowsRequest {
1795
+ projectSlug?: string;
1796
+ environment?: Environment;
1797
+ isActive?: boolean;
1798
+ limit?: number;
1799
+ cursor?: string;
1800
+ }
1801
+ interface ListWorkflowsResponse {
1802
+ items: Workflow[];
1803
+ nextCursor: string | null;
1804
+ }
1805
+ interface DeleteWorkflowRequest {
1806
+ id: string;
1807
+ projectSlug?: string;
1808
+ }
1809
+ interface WebhookConfig {
1810
+ url: string;
1811
+ secret?: string;
1812
+ }
1813
+ interface RunWorkflowRequest {
1814
+ workflowId?: string;
1815
+ workflowSlug?: string;
1816
+ projectSlug?: string;
1817
+ environment?: Environment;
1818
+ variables?: Record<string, unknown>;
1819
+ metadata?: Record<string, unknown>;
1820
+ webhook?: WebhookConfig;
1821
+ }
1822
+ interface RunWorkflowResponse {
1823
+ id: string;
1824
+ status: string;
1825
+ workflowId: string;
1826
+ }
1827
+ interface GetRunRequest {
1828
+ id: string;
1829
+ projectSlug?: string;
1830
+ environment?: Environment;
1831
+ }
1832
+ interface ListRunsRequest {
1833
+ workflowId?: string;
1834
+ workflowSlug?: string;
1835
+ projectSlug?: string;
1836
+ environment?: Environment;
1837
+ status?: RunStatus;
1838
+ limit?: number;
1839
+ cursor?: string;
1840
+ }
1841
+ interface ListRunsResponse {
1842
+ items: WorkflowRun[];
1843
+ nextCursor: string | null;
1844
+ }
1845
+ interface CancelRunRequest {
1846
+ id: string;
1847
+ projectSlug?: string;
1848
+ }
1849
+
1850
+ /**
1851
+ * Stack0 Workflows Client
1852
+ * AI workflow orchestration and execution
1853
+ */
1854
+
1855
+ declare class Workflows {
1856
+ private http;
1857
+ constructor(config: HttpClientConfig);
1858
+ /**
1859
+ * Create a new workflow
1860
+ *
1861
+ * @example
1862
+ * ```typescript
1863
+ * const workflow = await workflows.create({
1864
+ * slug: 'content-pipeline',
1865
+ * name: 'Content Generation Pipeline',
1866
+ * steps: [
1867
+ * {
1868
+ * id: 'generate',
1869
+ * name: 'Generate Content',
1870
+ * type: 'llm',
1871
+ * provider: 'anthropic',
1872
+ * model: 'claude-sonnet-4-20250514',
1873
+ * config: {
1874
+ * prompt: 'Write a blog post about {{topic}}',
1875
+ * maxTokens: 2000,
1876
+ * },
1877
+ * },
1878
+ * ],
1879
+ * variables: [
1880
+ * { name: 'topic', type: 'string', required: true },
1881
+ * ],
1882
+ * });
1883
+ * ```
1884
+ */
1885
+ create(request: CreateWorkflowRequest): Promise<CreateWorkflowResponse>;
1886
+ /**
1887
+ * Get a workflow by ID or slug
1888
+ *
1889
+ * @example
1890
+ * ```typescript
1891
+ * const workflow = await workflows.get({ slug: 'content-pipeline' });
1892
+ * console.log(workflow.steps);
1893
+ * ```
1894
+ */
1895
+ get(request: GetWorkflowRequest): Promise<Workflow>;
1896
+ /**
1897
+ * List workflows with pagination
1898
+ *
1899
+ * @example
1900
+ * ```typescript
1901
+ * const { items, nextCursor } = await workflows.list({
1902
+ * environment: 'production',
1903
+ * isActive: true,
1904
+ * limit: 20,
1905
+ * });
1906
+ * ```
1907
+ */
1908
+ list(request?: ListWorkflowsRequest): Promise<ListWorkflowsResponse>;
1909
+ /**
1910
+ * Update a workflow
1911
+ *
1912
+ * @example
1913
+ * ```typescript
1914
+ * await workflows.update({
1915
+ * id: 'workflow-id',
1916
+ * name: 'Updated Pipeline',
1917
+ * isActive: false,
1918
+ * });
1919
+ * ```
1920
+ */
1921
+ update(request: UpdateWorkflowRequest): Promise<{
1922
+ success: boolean;
1923
+ version: number;
1924
+ }>;
1925
+ /**
1926
+ * Delete a workflow
1927
+ *
1928
+ * @example
1929
+ * ```typescript
1930
+ * await workflows.delete({ id: 'workflow-id' });
1931
+ * ```
1932
+ */
1933
+ delete(request: DeleteWorkflowRequest): Promise<{
1934
+ success: boolean;
1935
+ }>;
1936
+ /**
1937
+ * Run a workflow
1938
+ *
1939
+ * @example
1940
+ * ```typescript
1941
+ * const run = await workflows.run({
1942
+ * workflowSlug: 'content-pipeline',
1943
+ * variables: {
1944
+ * topic: 'artificial intelligence',
1945
+ * },
1946
+ * webhook: {
1947
+ * url: 'https://example.com/webhook',
1948
+ * secret: 'webhook-secret',
1949
+ * },
1950
+ * });
1951
+ * console.log(run.id, run.status);
1952
+ * ```
1953
+ */
1954
+ run(request: RunWorkflowRequest): Promise<RunWorkflowResponse>;
1955
+ /**
1956
+ * Get a workflow run by ID
1957
+ *
1958
+ * @example
1959
+ * ```typescript
1960
+ * const run = await workflows.getRun({ id: 'run-id' });
1961
+ * if (run.status === 'completed') {
1962
+ * console.log(run.output);
1963
+ * }
1964
+ * ```
1965
+ */
1966
+ getRun(request: GetRunRequest): Promise<WorkflowRun>;
1967
+ /**
1968
+ * List workflow runs with pagination
1969
+ *
1970
+ * @example
1971
+ * ```typescript
1972
+ * const { items } = await workflows.listRuns({
1973
+ * workflowId: 'workflow-id',
1974
+ * status: 'completed',
1975
+ * });
1976
+ * ```
1977
+ */
1978
+ listRuns(request?: ListRunsRequest): Promise<ListRunsResponse>;
1979
+ /**
1980
+ * Cancel a running workflow
1981
+ *
1982
+ * @example
1983
+ * ```typescript
1984
+ * await workflows.cancelRun({ id: 'run-id' });
1985
+ * ```
1986
+ */
1987
+ cancelRun(request: CancelRunRequest): Promise<{
1988
+ success: boolean;
1989
+ }>;
1990
+ /**
1991
+ * Run a workflow and wait for completion
1992
+ *
1993
+ * @example
1994
+ * ```typescript
1995
+ * const run = await workflows.runAndWait({
1996
+ * workflowSlug: 'content-pipeline',
1997
+ * variables: { topic: 'AI' },
1998
+ * });
1999
+ * console.log(run.output);
2000
+ * ```
2001
+ */
2002
+ runAndWait(request: RunWorkflowRequest, options?: {
2003
+ pollInterval?: number;
2004
+ timeout?: number;
2005
+ }): Promise<WorkflowRun>;
2006
+ private convertDates;
2007
+ private convertRunDates;
2008
+ }
2009
+
2010
+ /**
2011
+ * Stack0 Memory SDK Types
2012
+ * Type definitions for the Memory API (agent memory management)
2013
+ */
2014
+
2015
+ type MemoryType = "preference" | "fact" | "event" | "relationship" | "instruction" | "pattern";
2016
+ interface AgentSettings {
2017
+ autoClassify?: boolean;
2018
+ autoExtractEntities?: boolean;
2019
+ embeddingModel?: string;
2020
+ }
2021
+ interface CreateAgentRequest {
2022
+ name: string;
2023
+ description?: string;
2024
+ settings?: AgentSettings;
2025
+ environment?: Environment$1;
2026
+ }
2027
+ interface Agent {
2028
+ id: string;
2029
+ organizationId: string;
2030
+ projectId?: string;
2031
+ name: string;
2032
+ description?: string;
2033
+ metadata?: Record<string, unknown>;
2034
+ environment: string;
2035
+ settings?: Record<string, unknown>;
2036
+ totalMemories: number;
2037
+ totalCollections: number;
2038
+ totalEntities: number;
2039
+ createdAt: string;
2040
+ updatedAt?: string;
2041
+ }
2042
+ interface UpdateAgentRequest {
2043
+ name?: string;
2044
+ description?: string;
2045
+ settings?: AgentSettings;
2046
+ environment?: Environment$1;
2047
+ }
2048
+ interface ListAgentsParams {
2049
+ environment?: string;
2050
+ }
2051
+ interface StoreMemoryRequest {
2052
+ agentId: string;
2053
+ content: string;
2054
+ collectionSlug?: string;
2055
+ type?: MemoryType;
2056
+ source?: string;
2057
+ tags?: string[];
2058
+ confidence?: number;
2059
+ metadata?: Record<string, unknown>;
2060
+ expiresAt?: string;
2061
+ }
2062
+ interface MemoryResponse {
2063
+ id: string;
2064
+ agentId: string;
2065
+ collectionId: string;
2066
+ content: string;
2067
+ type?: string;
2068
+ tier: string;
2069
+ source?: string;
2070
+ tags?: string[];
2071
+ confidence: number;
2072
+ metadata?: Record<string, unknown>;
2073
+ expiresAt?: string;
2074
+ compactedFrom?: string[];
2075
+ hasEmbedding?: boolean;
2076
+ createdAt: string;
2077
+ updatedAt?: string;
2078
+ }
2079
+ interface StoreBatchRequest {
2080
+ agentId: string;
2081
+ memories: Omit<StoreMemoryRequest, "agentId">[];
2082
+ }
2083
+ interface RecallRequest {
2084
+ agentId: string;
2085
+ query: string;
2086
+ collectionSlug?: string;
2087
+ limit?: number;
2088
+ types?: string[];
2089
+ tiers?: string[];
2090
+ minConfidence?: number;
2091
+ tags?: string[];
2092
+ }
2093
+ interface RecallResult extends MemoryResponse {
2094
+ score: number;
2095
+ similarityMethod?: "vector" | "keyword";
2096
+ }
2097
+ interface SearchRequest {
2098
+ agentId: string;
2099
+ query: string;
2100
+ collectionSlug?: string;
2101
+ limit?: number;
2102
+ offset?: number;
2103
+ }
2104
+ interface SearchResult {
2105
+ memories: MemoryResponse[];
2106
+ total: number;
2107
+ limit: number;
2108
+ offset: number;
2109
+ }
2110
+ interface ListMemoriesParams {
2111
+ agentId: string;
2112
+ collectionSlug?: string;
2113
+ type?: string;
2114
+ tier?: string;
2115
+ limit?: number;
2116
+ offset?: number;
2117
+ sortBy?: string;
2118
+ sortOrder?: "asc" | "desc";
2119
+ }
2120
+ interface UpdateMemoryRequest {
2121
+ content?: string;
2122
+ type?: string;
2123
+ tier?: string;
2124
+ tags?: string[];
2125
+ confidence?: number;
2126
+ metadata?: Record<string, unknown>;
2127
+ expiresAt?: string;
2128
+ }
2129
+ interface DeleteManyRequest {
2130
+ agentId: string;
2131
+ memoryIds: string[];
2132
+ }
2133
+ interface CreateCollectionRequest {
2134
+ agentId: string;
2135
+ name: string;
2136
+ slug: string;
2137
+ description?: string;
2138
+ compaction?: Record<string, unknown>;
2139
+ retention?: Record<string, unknown>;
2140
+ }
2141
+ interface CollectionResponse {
2142
+ id: string;
2143
+ agentId: string;
2144
+ slug: string;
2145
+ name?: string;
2146
+ description?: string;
2147
+ compaction?: Record<string, unknown>;
2148
+ retention?: Record<string, unknown>;
2149
+ lastCompactionAt?: string;
2150
+ nextCompactionAt?: string;
2151
+ createdAt: string;
2152
+ updatedAt?: string;
2153
+ }
2154
+ interface UpdateCollectionRequest {
2155
+ name?: string;
2156
+ description?: string;
2157
+ compaction?: Record<string, unknown>;
2158
+ retention?: Record<string, unknown>;
2159
+ }
2160
+ interface CollectionStats {
2161
+ collectionId: string;
2162
+ totalMemories: number;
2163
+ byTier: Record<string, number>;
2164
+ byType: Record<string, number>;
2165
+ oldestMemory?: string;
2166
+ newestMemory?: string;
2167
+ }
2168
+ interface CompactRequest {
2169
+ tier?: string;
2170
+ }
2171
+ interface CompactionJob {
2172
+ id: string;
2173
+ agentId: string;
2174
+ collectionId: string;
2175
+ status: string;
2176
+ tier: string;
2177
+ memoriesQueued: number;
2178
+ memoriesProcessed: number;
2179
+ memoriesCreated: number;
2180
+ memoriesArchived: number;
2181
+ durationMs?: number;
2182
+ creditsUsed?: number;
2183
+ error?: string;
2184
+ createdAt: string;
2185
+ completedAt?: string;
2186
+ }
2187
+ type EntityType = "person" | "organization" | "place" | "concept" | "product" | "event";
2188
+ interface Entity {
2189
+ id: string;
2190
+ agentId: string;
2191
+ name: string;
2192
+ type: EntityType;
2193
+ metadata?: Record<string, unknown>;
2194
+ firstSeenAt: string;
2195
+ lastSeenAt: string;
2196
+ mentionCount: number;
2197
+ createdAt: string;
2198
+ updatedAt?: string;
2199
+ }
2200
+ interface EntityRelation {
2201
+ id: string;
2202
+ agentId: string;
2203
+ sourceEntityId: string;
2204
+ targetEntityId: string;
2205
+ sourceEntity?: Entity;
2206
+ targetEntity?: Entity;
2207
+ relationType: string;
2208
+ strength: number;
2209
+ metadata?: Record<string, unknown>;
2210
+ createdAt: string;
2211
+ updatedAt?: string;
2212
+ }
2213
+ interface ListEntitiesParams {
2214
+ agentId: string;
2215
+ type?: EntityType;
2216
+ limit?: number;
2217
+ offset?: number;
2218
+ }
2219
+ interface GetEntityParams {
2220
+ entityId: string;
2221
+ }
2222
+ interface ListEntitiesResult {
2223
+ entities: Entity[];
2224
+ total: number;
2225
+ }
2226
+
2227
+ /**
2228
+ * Memory Agents client for Stack0 Memory API
2229
+ */
2230
+
2231
+ declare class MemoryAgents {
2232
+ private http;
2233
+ constructor(http: HttpClient);
2234
+ /**
2235
+ * Create a new memory agent
2236
+ */
2237
+ create(request: CreateAgentRequest): Promise<Agent>;
2238
+ /**
2239
+ * List all memory agents
2240
+ */
2241
+ list(params?: ListAgentsParams): Promise<Agent[]>;
2242
+ /**
2243
+ * Get a memory agent by ID
2244
+ */
2245
+ get(agentId: string): Promise<Agent>;
2246
+ /**
2247
+ * Update a memory agent
2248
+ */
2249
+ update(agentId: string, request: UpdateAgentRequest): Promise<Agent>;
2250
+ /**
2251
+ * Delete a memory agent
2252
+ */
2253
+ delete(agentId: string): Promise<void>;
2254
+ }
2255
+
2256
+ /**
2257
+ * Memory Collections client for Stack0 Memory API
2258
+ */
2259
+
2260
+ declare class MemoryCollections {
2261
+ private http;
2262
+ constructor(http: HttpClient);
2263
+ /**
2264
+ * Create a new collection for an agent
2265
+ */
2266
+ create(request: CreateCollectionRequest): Promise<CollectionResponse>;
2267
+ /**
2268
+ * List all collections for an agent
2269
+ */
2270
+ list(agentId: string): Promise<CollectionResponse[]>;
2271
+ /**
2272
+ * Get a collection by slug
2273
+ */
2274
+ get(agentId: string, collectionSlug: string): Promise<CollectionResponse>;
2275
+ /**
2276
+ * Update a collection
2277
+ */
2278
+ update(agentId: string, collectionSlug: string, request: UpdateCollectionRequest): Promise<CollectionResponse>;
2279
+ /**
2280
+ * Delete a collection
2281
+ */
2282
+ delete(agentId: string, collectionSlug: string): Promise<void>;
2283
+ /**
2284
+ * Get collection statistics
2285
+ */
2286
+ stats(agentId: string, collectionSlug: string): Promise<CollectionStats>;
2287
+ /**
2288
+ * Trigger compaction for a collection
2289
+ */
2290
+ compact(agentId: string, collectionSlug: string, request?: CompactRequest): Promise<CompactionJob>;
2291
+ /**
2292
+ * Get a compaction job by ID
2293
+ */
2294
+ getCompactionJob(agentId: string, collectionSlug: string, jobId: string): Promise<CompactionJob>;
2295
+ }
2296
+
2297
+ declare class MemoryEntities {
2298
+ private http;
2299
+ constructor(http: HttpClient);
2300
+ list(params: ListEntitiesParams): Promise<ListEntitiesResult>;
2301
+ get(entityId: string): Promise<Entity>;
2302
+ getRelations(entityId: string): Promise<EntityRelation[]>;
2303
+ }
2304
+
2305
+ /**
2306
+ * Stack0 Memory Client
2307
+ * Agent memory management with collections, recall, and compaction
2308
+ */
2309
+
2310
+ declare class Memory {
2311
+ private http;
2312
+ /** Manage memory agents */
2313
+ readonly agents: MemoryAgents;
2314
+ /** Manage memory collections */
2315
+ readonly collections: MemoryCollections;
2316
+ /** Manage extracted entities */
2317
+ readonly entities: MemoryEntities;
2318
+ constructor(config: HttpClientConfig);
2319
+ /**
2320
+ * Store a memory
2321
+ *
2322
+ * @example
2323
+ * ```typescript
2324
+ * const memory = await stack0.memory.store({
2325
+ * agentId: 'agent_123',
2326
+ * content: 'User prefers dark mode',
2327
+ * type: 'preference',
2328
+ * tags: ['ui', 'settings'],
2329
+ * });
2330
+ * ```
2331
+ */
2332
+ store(request: StoreMemoryRequest): Promise<MemoryResponse>;
2333
+ /**
2334
+ * Store multiple memories in a batch
2335
+ *
2336
+ * @example
2337
+ * ```typescript
2338
+ * const results = await stack0.memory.storeBatch({
2339
+ * agentId: 'agent_123',
2340
+ * memories: [
2341
+ * { content: 'User prefers dark mode', type: 'preference' },
2342
+ * { content: 'User is based in NYC', type: 'fact' },
2343
+ * ],
2344
+ * });
2345
+ * ```
2346
+ */
2347
+ storeBatch(request: StoreBatchRequest): Promise<MemoryResponse[]>;
2348
+ /**
2349
+ * Recall memories using semantic search (vector similarity)
2350
+ *
2351
+ * @example
2352
+ * ```typescript
2353
+ * const results = await stack0.memory.recall({
2354
+ * agentId: 'agent_123',
2355
+ * query: 'What are the user preferences?',
2356
+ * limit: 10,
2357
+ * });
2358
+ * ```
2359
+ */
2360
+ recall(request: RecallRequest): Promise<RecallResult[]>;
2361
+ /**
2362
+ * Search memories using full-text search
2363
+ *
2364
+ * @example
2365
+ * ```typescript
2366
+ * const results = await stack0.memory.search({
2367
+ * agentId: 'agent_123',
2368
+ * query: 'dark mode',
2369
+ * limit: 20,
2370
+ * });
2371
+ * ```
2372
+ */
2373
+ search(request: SearchRequest): Promise<SearchResult>;
2374
+ /**
2375
+ * Get a memory by ID
2376
+ */
2377
+ get(memoryId: string): Promise<MemoryResponse>;
2378
+ /**
2379
+ * List memories with optional filters
2380
+ *
2381
+ * @example
2382
+ * ```typescript
2383
+ * const memories = await stack0.memory.list({
2384
+ * agentId: 'agent_123',
2385
+ * type: 'preference',
2386
+ * limit: 50,
2387
+ * });
2388
+ * ```
2389
+ */
2390
+ list(params: ListMemoriesParams): Promise<MemoryResponse[]>;
2391
+ /**
2392
+ * Update a memory
2393
+ */
2394
+ update(memoryId: string, request: UpdateMemoryRequest): Promise<MemoryResponse>;
2395
+ /**
2396
+ * Delete a memory by ID
2397
+ */
2398
+ delete(memoryId: string): Promise<void>;
2399
+ /**
2400
+ * Delete multiple memories
2401
+ */
2402
+ deleteMany(request: DeleteManyRequest): Promise<void>;
2403
+ }
2404
+
1668
2405
  /**
1669
2406
  * Stack0 SDK
1670
2407
  * Official SDK for Stack0 services
@@ -1718,6 +2455,24 @@ declare class Marketing {
1718
2455
  * projectSlug: 'my-project',
1719
2456
  * environment: 'production',
1720
2457
  * });
2458
+ *
2459
+ * // Run an AI workflow
2460
+ * const run = await stack0.workflows.runAndWait({
2461
+ * workflowSlug: 'content-pipeline',
2462
+ * variables: { topic: 'AI trends' },
2463
+ * });
2464
+ * console.log(run.output);
2465
+ *
2466
+ * // Store and recall agent memories
2467
+ * await stack0.memory.store({
2468
+ * agentId: 'agent_123',
2469
+ * content: 'User prefers dark mode',
2470
+ * type: 'preference',
2471
+ * });
2472
+ * const memories = await stack0.memory.recall({
2473
+ * agentId: 'agent_123',
2474
+ * query: 'user preferences',
2475
+ * });
1721
2476
  * ```
1722
2477
  */
1723
2478
 
@@ -1741,6 +2496,8 @@ declare class Stack0 {
1741
2496
  extraction: Extraction;
1742
2497
  integrations: Integrations;
1743
2498
  marketing: Marketing;
2499
+ workflows: Workflows;
2500
+ memory: Memory;
1744
2501
  /**
1745
2502
  * @deprecated Use `screenshots` and `extraction` instead. Will be removed in a future version.
1746
2503
  */
@@ -1748,4 +2505,4 @@ declare class Stack0 {
1748
2505
  constructor(config: Stack0Config);
1749
2506
  }
1750
2507
 
1751
- export { type AnalyticsOverviewRequest, type AnalyticsOverviewResponse, type ApprovalStatus, type ApproveContentRequest, type AssetJob, type AssetJobStatus, type AssetJobType, CDN, type CalendarEntry, type CancelAssetJobResponse, type CancelCalendarEntryResponse, type Channel, type CommunicationUser, type Company, type Connection, type Connector, type ConnectorCategory, type Contact, type Content, type ContentPerformanceItem, type ContentPerformanceRequest, type ContentPerformanceResponse, type ContentStatus, type ContentType, type CreateAssetJobRequest, type CreateCompanyInput, type CreateContactInput, type CreateContentRequest, type CreateDealInput, type CreateScriptRequest, type CreateScriptVersionRequest, type CurrentUsageResponse, type Deal, type DeleteScriptResponse, type DiscoverTrendsRequest, type DiscoverTrendsResponse, type DismissOpportunityRequest, Extraction, type GenerateOpportunitiesRequest, type GenerateOpportunitiesResponse, type GetCurrentUsageRequest, type GetSettingsRequest, type GetTotalUsageRequest, type GetUsageHistoryRequest, type Address as IntegrationAddress, type ColumnType as IntegrationColumnType, type CreateDocumentInput as IntegrationCreateDocumentInput, type CreateFolderInput as IntegrationCreateFolderInput, type CreateTableRowInput as IntegrationCreateTableRowInput, type Document as IntegrationDocument, type IntegrationEmailAddress, type File as IntegrationFile, type FilePermission as IntegrationFilePermission, type IntegrationFolder, type MessageAttachment as IntegrationMessageAttachment, type MessageReaction as IntegrationMessageReaction, type PhoneNumber as IntegrationPhoneNumber, type SelectOption as IntegrationSelectOption, type Table as IntegrationTable, type TableColumn as IntegrationTableColumn, type TableRow as IntegrationTableRow, type UpdateDocumentInput as IntegrationUpdateDocumentInput, type UpdateTableRowInput as IntegrationUpdateTableRowInput, Integrations, type ListOptions as IntegrationsListOptions, type PaginatedResult as IntegrationsPaginatedResult, type ListAssetJobsRequest, type ListAssetJobsResponse, type ListCalendarEntriesRequest, type ListCalendarEntriesResponse, type ListContentRequest, type ListContentResponse, type ListOpportunitiesRequest, type ListOpportunitiesResponse, type ListScriptsRequest, type ListScriptsResponse, type ListTrendsRequest, type ListTrendsResponse, Mail, type MarkPublishedRequest, Marketing, type MarketingEnvironment, type MarketingSettings, type MarketingUsage, type Message, type Opportunity, type OpportunityConversionRequest, type OpportunityConversionResponse, type PassthroughRequest, type RecordUsageRequest, type RejectContentRequest, type RetryAssetJobResponse, type ScheduleContentRequest, Screenshots, type Script, type ScriptSlide, type SendMessageInput, Stack0, type Stack0Config, type TotalUsageResponse, type Trend, type TrendAnalyticsRequest, type TrendAnalyticsResponse, type TrendStatus, type UpdateAssetJobStatusRequest, type UpdateCalendarEntryRequest, type UpdateCompanyInput, type UpdateContactInput, type UpdateContentRequest, type UpdateDealInput, type UpdateScriptRequest, type UpdateSettingsRequest, type UpdateSettingsResponse, type UpdateTrendStatusRequest, type UpdateTrendStatusResponse, type UploadFileInput, type UsageHistoryResponse, Webdata, Stack0 as default };
2508
+ export { type Agent, type AgentSettings, type AnalyticsOverviewRequest, type AnalyticsOverviewResponse, type ApprovalStatus, type ApproveContentRequest, type AssetJob, type AssetJobStatus, type AssetJobType, CDN, type CalendarEntry, type CancelAssetJobResponse, type CancelCalendarEntryResponse, type CancelRunRequest, type Channel, type CollectionResponse, type CollectionStats, type CommunicationUser, type CompactRequest, type CompactionJob, type Company, type Connection, type Connector, type ConnectorCategory, type Contact, type Content, type ContentPerformanceItem, type ContentPerformanceRequest, type ContentPerformanceResponse, type ContentStatus, type ContentType, type CreateAgentRequest, type CreateAssetJobRequest, type CreateCollectionRequest, type CreateCompanyInput, type CreateContactInput, type CreateContentRequest, type CreateDealInput, type CreateScriptRequest, type CreateScriptVersionRequest, type CreateWorkflowRequest, type CreateWorkflowResponse, type CurrentUsageResponse, type Deal, type DeleteManyRequest, type DeleteScriptResponse, type DeleteWorkflowRequest, type DiscoverTrendsRequest, type DiscoverTrendsResponse, type DismissOpportunityRequest, type Entity, type EntityRelation, type EntityType, type Environment, Extraction, type GenerateOpportunitiesRequest, type GenerateOpportunitiesResponse, type GetCurrentUsageRequest, type GetEntityParams, type GetRunRequest, type GetSettingsRequest, type GetTotalUsageRequest, type GetUsageHistoryRequest, type GetWorkflowRequest, type Address as IntegrationAddress, type ColumnType as IntegrationColumnType, type CreateDocumentInput as IntegrationCreateDocumentInput, type CreateFolderInput as IntegrationCreateFolderInput, type CreateTableRowInput as IntegrationCreateTableRowInput, type Document as IntegrationDocument, type IntegrationEmailAddress, type File as IntegrationFile, type FilePermission as IntegrationFilePermission, type IntegrationFolder, type MessageAttachment as IntegrationMessageAttachment, type MessageReaction as IntegrationMessageReaction, type PhoneNumber as IntegrationPhoneNumber, type SelectOption as IntegrationSelectOption, type Table as IntegrationTable, type TableColumn as IntegrationTableColumn, type TableRow as IntegrationTableRow, type UpdateDocumentInput as IntegrationUpdateDocumentInput, type UpdateTableRowInput as IntegrationUpdateTableRowInput, Integrations, type ListOptions as IntegrationsListOptions, type PaginatedResult as IntegrationsPaginatedResult, type ListAgentsParams, type ListAssetJobsRequest, type ListAssetJobsResponse, type ListCalendarEntriesRequest, type ListCalendarEntriesResponse, type ListContentRequest, type ListContentResponse, type ListEntitiesParams, type ListEntitiesResult, type ListMemoriesParams, type ListOpportunitiesRequest, type ListOpportunitiesResponse, type ListRunsRequest, type ListRunsResponse, type ListScriptsRequest, type ListScriptsResponse, type ListTrendsRequest, type ListTrendsResponse, type ListWorkflowsRequest, type ListWorkflowsResponse, Mail, type MarkPublishedRequest, Marketing, type MarketingEnvironment, type MarketingSettings, type MarketingUsage, Memory, MemoryAgents, MemoryCollections, MemoryEntities, type MemoryResponse, type MemoryType, type Message, type Opportunity, type OpportunityConversionRequest, type OpportunityConversionResponse, type PassthroughRequest, type Provider, type RecallRequest, type RecallResult, type RecordUsageRequest, type RejectContentRequest, type ResponseFormat, type RetryAssetJobResponse, type RetryConfig, type RunStatus, type RunWorkflowRequest, type RunWorkflowResponse, type ScheduleContentRequest, Screenshots, type Script, type ScriptSlide, type SearchRequest, type SearchResult, type SendMessageInput, Stack0, type Stack0Config, type StepConfig, type StepDefinition, type StepRunStatus, type StepState, type StepType, type StoreBatchRequest, type StoreMemoryRequest, type TotalUsageResponse, type Trend, type TrendAnalyticsRequest, type TrendAnalyticsResponse, type TrendStatus, type UpdateAgentRequest, type UpdateAssetJobStatusRequest, type UpdateCalendarEntryRequest, type UpdateCollectionRequest, type UpdateCompanyInput, type UpdateContactInput, type UpdateContentRequest, type UpdateDealInput, type UpdateMemoryRequest, type UpdateScriptRequest, type UpdateSettingsRequest, type UpdateSettingsResponse, type UpdateTrendStatusRequest, type UpdateTrendStatusResponse, type UpdateWorkflowRequest, type UploadFileInput, type UsageHistoryResponse, type VariableDefinition, Webdata, type WebhookConfig, type Workflow, type WorkflowRun, Workflows, Stack0 as default };