@inferencesh/sdk 0.6.29 → 0.6.47

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.
Files changed (53) hide show
  1. package/README.md +35 -0
  2. package/dist/agent/actions.js +72 -13
  3. package/dist/agent/api.d.ts +30 -51
  4. package/dist/agent/api.js +129 -154
  5. package/dist/agent/provider.js +18 -1
  6. package/dist/agent/reducer.js +50 -11
  7. package/dist/agent/types.d.ts +34 -1
  8. package/dist/api/agents.d.ts +23 -14
  9. package/dist/api/agents.js +22 -4
  10. package/dist/api/api-keys.d.ts +4 -3
  11. package/dist/api/apps.d.ts +16 -15
  12. package/dist/api/chats.d.ts +14 -9
  13. package/dist/api/chats.js +6 -0
  14. package/dist/api/engines.d.ts +14 -13
  15. package/dist/api/files.d.ts +4 -3
  16. package/dist/api/files.js +2 -2
  17. package/dist/api/flow-runs.d.ts +8 -7
  18. package/dist/api/flows.d.ts +11 -10
  19. package/dist/api/integrations.d.ts +9 -8
  20. package/dist/api/integrations.js +8 -8
  21. package/dist/api/knowledge.d.ts +25 -24
  22. package/dist/api/mcp-servers.d.ts +10 -9
  23. package/dist/api/projects.d.ts +6 -5
  24. package/dist/api/search.d.ts +3 -2
  25. package/dist/api/secrets.d.ts +6 -5
  26. package/dist/api/sessions.d.ts +5 -4
  27. package/dist/api/sessions.js +2 -3
  28. package/dist/api/tasks.d.ts +14 -11
  29. package/dist/api/tasks.js +10 -4
  30. package/dist/api/teams.d.ts +16 -17
  31. package/dist/delta.d.ts +15 -0
  32. package/dist/delta.js +84 -0
  33. package/dist/hook-builder.d.ts +23 -0
  34. package/dist/hook-builder.js +50 -0
  35. package/dist/http/client.d.ts +9 -1
  36. package/dist/http/client.js +12 -3
  37. package/dist/http/response.d.ts +9 -0
  38. package/dist/http/response.js +1 -0
  39. package/dist/http/stream.d.ts +1 -0
  40. package/dist/http/stream.js +8 -3
  41. package/dist/http/streamable.d.ts +3 -1
  42. package/dist/http/streamable.js +10 -1
  43. package/dist/index.d.ts +11 -5
  44. package/dist/index.js +6 -1
  45. package/dist/proxy/index.d.ts +2 -0
  46. package/dist/proxy/index.js +9 -0
  47. package/dist/tool-builder.d.ts +2 -0
  48. package/dist/tool-builder.js +5 -0
  49. package/dist/types.d.ts +1204 -162
  50. package/dist/types.js +256 -30
  51. package/dist/utils.d.ts +13 -0
  52. package/dist/utils.js +43 -3
  53. package/package.json +8 -5
@@ -1,4 +1,5 @@
1
1
  import { HttpClient } from '../http/client';
2
+ import type { Response } from '../http/response';
2
3
  import { FileDTO as File, CursorListRequest, CursorListResponse } from '../types';
3
4
  export interface UploadFileOptions {
4
5
  filename?: string;
@@ -34,15 +35,15 @@ export declare class FilesAPI {
34
35
  /**
35
36
  * List files with cursor-based pagination
36
37
  */
37
- list(params?: Partial<CursorListRequest>): Promise<CursorListResponse<File>>;
38
+ list(params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<File>>>;
38
39
  /**
39
40
  * Get a file by ID
40
41
  */
41
- get(fileId: string): Promise<File>;
42
+ get(fileId: string): Promise<Response<File>>;
42
43
  /**
43
44
  * Delete a file
44
45
  */
45
- delete(fileId: string): Promise<void>;
46
+ delete(fileId: string): Promise<Response<void>>;
46
47
  /**
47
48
  * Upload a file (Blob or base64 string)
48
49
  */
package/dist/api/files.js CHANGED
@@ -129,10 +129,10 @@ export class FilesAPI {
129
129
  path: options.path,
130
130
  size: resolved.size,
131
131
  };
132
- const response = await this.http.request('post', '/files', {
132
+ const resp = await this.http.request('post', '/files', {
133
133
  data: { files: [fileRequest] },
134
134
  });
135
- const file = response[0];
135
+ const file = resp.data[0];
136
136
  // Step 2: Upload the file content to the provided upload_url
137
137
  if (!file.upload_url) {
138
138
  throw new Error('No upload URL provided by the server');
@@ -1,4 +1,5 @@
1
1
  import { HttpClient } from '../http/client';
2
+ import type { Response } from '../http/response';
2
3
  import { FlowRunDTO as FlowRun, CursorListRequest, CursorListResponse } from '../types';
3
4
  /**
4
5
  * Flow Runs API
@@ -9,27 +10,27 @@ export declare class FlowRunsAPI {
9
10
  /**
10
11
  * List flow runs with cursor-based pagination
11
12
  */
12
- list(params?: Partial<CursorListRequest>): Promise<CursorListResponse<FlowRun>>;
13
+ list(params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<FlowRun>>>;
13
14
  /**
14
15
  * Get a flow run by ID
15
16
  */
16
- get(flowRunId: string): Promise<FlowRun>;
17
+ get(flowRunId: string): Promise<Response<FlowRun>>;
17
18
  /**
18
19
  * Create a new flow run
19
20
  */
20
- create(flowId: string, input?: unknown): Promise<FlowRun>;
21
+ create(flowId: string, input?: unknown): Promise<Response<FlowRun>>;
21
22
  /**
22
23
  * Clone a flow run
23
24
  */
24
- clone(flowRunId: string): Promise<FlowRun>;
25
+ clone(flowRunId: string): Promise<Response<FlowRun>>;
25
26
  /**
26
27
  * Update a flow run
27
28
  */
28
- update(flowRunId: string, data: Partial<FlowRun>): Promise<FlowRun>;
29
+ update(flowRunId: string, data: Partial<FlowRun>): Promise<Response<FlowRun>>;
29
30
  /**
30
31
  * Cancel a flow run
31
32
  */
32
- cancel(flowRunId: string): Promise<void>;
33
+ cancel(flowRunId: string): Promise<Response<void>>;
33
34
  /**
34
35
  * Stream flow run updates
35
36
  */
@@ -41,6 +42,6 @@ export declare class FlowRunsAPI {
41
42
  /**
42
43
  * Update flow run visibility
43
44
  */
44
- updateVisibility(flowRunId: string, visibility: string): Promise<FlowRun>;
45
+ updateVisibility(flowRunId: string, visibility: string): Promise<Response<FlowRun>>;
45
46
  }
46
47
  export declare function createFlowRunsAPI(http: HttpClient): FlowRunsAPI;
@@ -1,4 +1,5 @@
1
1
  import { HttpClient } from '../http/client';
2
+ import type { Response } from '../http/response';
2
3
  import { FlowDTO as Flow, FlowVersionDTO, AppDTO as App, CursorListRequest, CursorListResponse } from '../types';
3
4
  /**
4
5
  * Flows API
@@ -9,43 +10,43 @@ export declare class FlowsAPI {
9
10
  /**
10
11
  * List flows with cursor-based pagination
11
12
  */
12
- list(params?: Partial<CursorListRequest>): Promise<CursorListResponse<Flow>>;
13
+ list(params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<Flow>>>;
13
14
  /**
14
15
  * Get a flow by ID
15
16
  */
16
- get(flowId: string): Promise<Flow>;
17
+ get(flowId: string): Promise<Response<Flow>>;
17
18
  /**
18
19
  * Create a new flow
19
20
  */
20
- create(name: string): Promise<Flow>;
21
+ create(name: string): Promise<Response<Flow>>;
21
22
  /**
22
23
  * Update a flow
23
24
  */
24
- update(flowId: string, data: Partial<Flow>): Promise<Flow>;
25
+ update(flowId: string, data: Partial<Flow>): Promise<Response<Flow>>;
25
26
  /**
26
27
  * Update flow visibility
27
28
  */
28
- updateVisibility(flowId: string, visibility: string): Promise<Flow>;
29
+ updateVisibility(flowId: string, visibility: string): Promise<Response<Flow>>;
29
30
  /**
30
31
  * Delete a flow
31
32
  */
32
- delete(flowId: string): Promise<void>;
33
+ delete(flowId: string): Promise<Response<void>>;
33
34
  /**
34
35
  * Duplicate a flow
35
36
  */
36
- duplicate(flowId: string): Promise<Flow>;
37
+ duplicate(flowId: string): Promise<Response<Flow>>;
37
38
  /**
38
39
  * List flow versions
39
40
  */
40
- listVersions(flowId: string, params?: Partial<CursorListRequest>): Promise<CursorListResponse<FlowVersionDTO>>;
41
+ listVersions(flowId: string, params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<FlowVersionDTO>>>;
41
42
  /**
42
43
  * Create an app from a flow
43
44
  */
44
- createApp(flowId: string): Promise<App>;
45
+ createApp(flowId: string): Promise<Response<App>>;
45
46
  /**
46
47
  * Transfer flow ownership to another team
47
48
  */
48
- transferOwnership(flowId: string, newTeamId: string): Promise<Flow>;
49
+ transferOwnership(flowId: string, newTeamId: string): Promise<Response<Flow>>;
49
50
  /**
50
51
  * Stream flow updates
51
52
  */
@@ -1,4 +1,5 @@
1
1
  import { HttpClient } from '../http/client';
2
+ import type { Response } from '../http/response';
2
3
  import { IntegrationDTO, IntegrationConfigDTO, IntegrationConnectRequest, IntegrationConnectResponse, CursorListRequest, CursorListResponse } from '../types';
3
4
  /**
4
5
  * Integrations API
@@ -9,33 +10,33 @@ export declare class IntegrationsAPI {
9
10
  /**
10
11
  * List integrations with cursor-based pagination
11
12
  */
12
- list(params?: Partial<CursorListRequest>): Promise<CursorListResponse<IntegrationDTO>>;
13
+ list(params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<IntegrationDTO>>>;
13
14
  /**
14
15
  * Get available integrations
15
16
  */
16
- listAvailable(): Promise<IntegrationConfigDTO[]>;
17
+ listAvailable(): Promise<Response<IntegrationConfigDTO[]>>;
17
18
  /**
18
19
  * Get integration configs
19
20
  */
20
- getConfigs(): Promise<IntegrationConfigDTO[]>;
21
+ getConfigs(): Promise<Response<IntegrationConfigDTO[]>>;
21
22
  /**
22
23
  * Get capabilities
23
24
  */
24
- getCapabilities(): Promise<unknown>;
25
+ getCapabilities(): Promise<Response<unknown>>;
25
26
  /**
26
27
  * Check requirements
27
28
  */
28
- checkRequirements(data: unknown): Promise<unknown>;
29
+ checkRequirements(data: unknown): Promise<Response<unknown>>;
29
30
  /**
30
31
  * Connect an integration
31
32
  */
32
- connect(data: IntegrationConnectRequest): Promise<IntegrationConnectResponse>;
33
+ connect(data: IntegrationConnectRequest): Promise<Response<IntegrationConnectResponse>>;
33
34
  /**
34
35
  * Get an integration by provider key
35
36
  */
36
- get(provider: string): Promise<IntegrationDTO>;
37
+ get(provider: string): Promise<Response<IntegrationDTO>>;
37
38
  /**
38
39
  * Disconnect an integration
39
40
  */
40
- disconnect(provider: string): Promise<void>;
41
+ disconnect(provider: string): Promise<Response<void>>;
41
42
  }
@@ -9,48 +9,48 @@ export class IntegrationsAPI {
9
9
  * List integrations with cursor-based pagination
10
10
  */
11
11
  async list(params) {
12
- return this.http.request('post', '/integrations/list', { data: params });
12
+ return this.http.request('post', '/credentials/list', { data: params });
13
13
  }
14
14
  /**
15
15
  * Get available integrations
16
16
  */
17
17
  async listAvailable() {
18
- return this.http.request('get', '/integrations/available');
18
+ return this.http.request('get', '/credentials/available');
19
19
  }
20
20
  /**
21
21
  * Get integration configs
22
22
  */
23
23
  async getConfigs() {
24
- return this.http.request('get', '/integrations/configs');
24
+ return this.http.request('get', '/credentials/configs');
25
25
  }
26
26
  /**
27
27
  * Get capabilities
28
28
  */
29
29
  async getCapabilities() {
30
- return this.http.request('get', '/integrations/capabilities');
30
+ return this.http.request('get', '/credentials/capabilities');
31
31
  }
32
32
  /**
33
33
  * Check requirements
34
34
  */
35
35
  async checkRequirements(data) {
36
- return this.http.request('post', '/integrations/check', { data });
36
+ return this.http.request('post', '/credentials/check', { data });
37
37
  }
38
38
  /**
39
39
  * Connect an integration
40
40
  */
41
41
  async connect(data) {
42
- return this.http.request('post', '/integrations', { data });
42
+ return this.http.request('post', '/credentials', { data });
43
43
  }
44
44
  /**
45
45
  * Get an integration by provider key
46
46
  */
47
47
  async get(provider) {
48
- return this.http.request('get', `/integrations/${provider}`);
48
+ return this.http.request('get', `/credentials/${provider}`);
49
49
  }
50
50
  /**
51
51
  * Disconnect an integration
52
52
  */
53
53
  async disconnect(provider) {
54
- return this.http.request('delete', `/integrations/${provider}`);
54
+ return this.http.request('delete', `/credentials/${provider}`);
55
55
  }
56
56
  }
@@ -1,4 +1,5 @@
1
1
  import { HttpClient } from '../http/client';
2
+ import type { Response } from '../http/response';
2
3
  import { KnowledgeDTO, KnowledgeVersionDTO, KnowledgeCreateRequest, SkillDTO, SkillVersionDTO, CursorListRequest, CursorListResponse, PublicSkillStoreDTO } from '../types';
3
4
  /**
4
5
  * Knowledge API
@@ -9,43 +10,43 @@ export declare class KnowledgeAPI {
9
10
  /**
10
11
  * List knowledge entries with cursor-based pagination
11
12
  */
12
- list(params?: Partial<CursorListRequest>): Promise<CursorListResponse<KnowledgeDTO>>;
13
+ list(params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<KnowledgeDTO>>>;
13
14
  /**
14
15
  * Get a knowledge entry by ID
15
16
  */
16
- get(id: string): Promise<KnowledgeDTO>;
17
+ get(id: string): Promise<Response<KnowledgeDTO>>;
17
18
  /**
18
19
  * Get a knowledge entry by namespace/name
19
20
  */
20
- getByName(namespace: string, name: string): Promise<KnowledgeDTO>;
21
+ getByName(namespace: string, name: string): Promise<Response<KnowledgeDTO>>;
21
22
  /**
22
23
  * Create a knowledge entry
23
24
  */
24
- create(data: KnowledgeCreateRequest): Promise<KnowledgeDTO>;
25
+ create(data: KnowledgeCreateRequest): Promise<Response<KnowledgeDTO>>;
25
26
  /**
26
27
  * Update a knowledge entry
27
28
  */
28
- update(id: string, data: Partial<KnowledgeDTO>): Promise<KnowledgeDTO>;
29
+ update(id: string, data: Partial<KnowledgeDTO>): Promise<Response<KnowledgeDTO>>;
29
30
  /**
30
31
  * Delete a knowledge entry
31
32
  */
32
- delete(id: string): Promise<void>;
33
+ delete(id: string): Promise<Response<void>>;
33
34
  /**
34
35
  * List knowledge versions
35
36
  */
36
- listVersions(id: string, params?: Partial<CursorListRequest>): Promise<CursorListResponse<KnowledgeVersionDTO>>;
37
+ listVersions(id: string, params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<KnowledgeVersionDTO>>>;
37
38
  /**
38
39
  * Get a specific version
39
40
  */
40
- getVersion(id: string, versionId: string): Promise<KnowledgeVersionDTO>;
41
+ getVersion(id: string, versionId: string): Promise<Response<KnowledgeVersionDTO>>;
41
42
  /**
42
43
  * Transfer ownership
43
44
  */
44
- transferOwnership(id: string, newTeamId: string): Promise<KnowledgeDTO>;
45
+ transferOwnership(id: string, newTeamId: string): Promise<Response<KnowledgeDTO>>;
45
46
  /**
46
47
  * Update visibility
47
48
  */
48
- updateVisibility(id: string, visibility: string): Promise<KnowledgeDTO>;
49
+ updateVisibility(id: string, visibility: string): Promise<Response<KnowledgeDTO>>;
49
50
  }
50
51
  /**
51
52
  * Skills API
@@ -56,57 +57,57 @@ export declare class SkillsAPI {
56
57
  /**
57
58
  * List skills with cursor-based pagination
58
59
  */
59
- list(params?: Partial<CursorListRequest>): Promise<CursorListResponse<SkillDTO>>;
60
+ list(params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<SkillDTO>>>;
60
61
  /**
61
62
  * Get a skill by ID
62
63
  */
63
- get(id: string): Promise<SkillDTO>;
64
+ get(id: string): Promise<Response<SkillDTO>>;
64
65
  /**
65
66
  * Get a skill by namespace/name
66
67
  */
67
- getByName(namespace: string, name: string): Promise<SkillDTO>;
68
+ getByName(namespace: string, name: string): Promise<Response<SkillDTO>>;
68
69
  /**
69
70
  * Resolve a skill (store + GitHub fallback)
70
71
  */
71
- resolve(ref: string, skill?: string): Promise<unknown>;
72
+ resolve(ref: string, skill?: string): Promise<Response<unknown>>;
72
73
  /**
73
74
  * Create/publish a skill
74
75
  */
75
- create(data: Partial<SkillDTO>): Promise<SkillDTO>;
76
+ create(data: Partial<SkillDTO>): Promise<Response<SkillDTO>>;
76
77
  /**
77
78
  * Update a skill
78
79
  */
79
- update(id: string, data: Partial<SkillDTO>): Promise<SkillDTO>;
80
+ update(id: string, data: Partial<SkillDTO>): Promise<Response<SkillDTO>>;
80
81
  /**
81
82
  * Delete a skill
82
83
  */
83
- delete(id: string): Promise<void>;
84
+ delete(id: string): Promise<Response<void>>;
84
85
  /**
85
86
  * List skill versions
86
87
  */
87
- listVersions(id: string, params?: Partial<CursorListRequest>): Promise<CursorListResponse<SkillVersionDTO>>;
88
+ listVersions(id: string, params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<SkillVersionDTO>>>;
88
89
  /**
89
90
  * Get a specific skill version
90
91
  */
91
- getVersion(id: string, versionId: string): Promise<SkillVersionDTO>;
92
+ getVersion(id: string, versionId: string): Promise<Response<SkillVersionDTO>>;
92
93
  /**
93
94
  * Download a skill
94
95
  */
95
- download(namespace: string, name: string): Promise<unknown>;
96
+ download(namespace: string, name: string): Promise<Response<unknown>>;
96
97
  /**
97
98
  * Get skill content
98
99
  */
99
- getContent(namespace: string, name: string): Promise<unknown>;
100
+ getContent(namespace: string, name: string): Promise<Response<unknown>>;
100
101
  /**
101
102
  * Transfer ownership
102
103
  */
103
- transferOwnership(id: string, newTeamId: string): Promise<SkillDTO>;
104
+ transferOwnership(id: string, newTeamId: string): Promise<Response<SkillDTO>>;
104
105
  /**
105
106
  * Update visibility
106
107
  */
107
- updateVisibility(id: string, visibility: string): Promise<SkillDTO>;
108
+ updateVisibility(id: string, visibility: string): Promise<Response<SkillDTO>>;
108
109
  /**
109
110
  * List skills in the public store
110
111
  */
111
- listStore(params?: Partial<CursorListRequest>): Promise<CursorListResponse<PublicSkillStoreDTO>>;
112
+ listStore(params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<PublicSkillStoreDTO>>>;
112
113
  }
@@ -1,4 +1,5 @@
1
1
  import { HttpClient } from '../http/client';
2
+ import type { Response } from '../http/response';
2
3
  import { MCPServerDTO, CursorListRequest, CursorListResponse } from '../types';
3
4
  /**
4
5
  * MCP Servers API
@@ -9,37 +10,37 @@ export declare class MCPServersAPI {
9
10
  /**
10
11
  * List public MCP servers
11
12
  */
12
- list(params?: Partial<CursorListRequest>): Promise<CursorListResponse<MCPServerDTO>>;
13
+ list(params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<MCPServerDTO>>>;
13
14
  /**
14
15
  * Get an MCP server by slug
15
16
  */
16
- get(slug: string): Promise<MCPServerDTO>;
17
+ get(slug: string): Promise<Response<MCPServerDTO>>;
17
18
  /**
18
19
  * List tools for an MCP server
19
20
  */
20
- listTools(slug: string): Promise<unknown[]>;
21
+ listTools(slug: string): Promise<Response<unknown[]>>;
21
22
  /**
22
23
  * Call a tool on an MCP server
23
24
  */
24
- callTool(slug: string, tool: string, input: unknown): Promise<unknown>;
25
+ callTool(slug: string, tool: string, input: unknown): Promise<Response<unknown>>;
25
26
  /**
26
27
  * List user's own MCP servers
27
28
  */
28
- listOwned(params?: Partial<CursorListRequest>): Promise<CursorListResponse<MCPServerDTO>>;
29
+ listOwned(params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<MCPServerDTO>>>;
29
30
  /**
30
31
  * Get a user's MCP server by ID
31
32
  */
32
- getOwned(id: string): Promise<MCPServerDTO>;
33
+ getOwned(id: string): Promise<Response<MCPServerDTO>>;
33
34
  /**
34
35
  * Create an MCP server
35
36
  */
36
- create(data: Partial<MCPServerDTO>): Promise<MCPServerDTO>;
37
+ create(data: Partial<MCPServerDTO>): Promise<Response<MCPServerDTO>>;
37
38
  /**
38
39
  * Update an MCP server
39
40
  */
40
- update(id: string, data: Partial<MCPServerDTO>): Promise<MCPServerDTO>;
41
+ update(id: string, data: Partial<MCPServerDTO>): Promise<Response<MCPServerDTO>>;
41
42
  /**
42
43
  * Delete an MCP server
43
44
  */
44
- delete(id: string): Promise<void>;
45
+ delete(id: string): Promise<Response<void>>;
45
46
  }
@@ -1,4 +1,5 @@
1
1
  import { HttpClient } from '../http/client';
2
+ import type { Response } from '../http/response';
2
3
  import { ProjectDTO, CursorListRequest, CursorListResponse } from '../types';
3
4
  /**
4
5
  * Projects API
@@ -9,21 +10,21 @@ export declare class ProjectsAPI {
9
10
  /**
10
11
  * List projects with cursor-based pagination
11
12
  */
12
- list(params?: Partial<CursorListRequest>): Promise<CursorListResponse<ProjectDTO>>;
13
+ list(params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<ProjectDTO>>>;
13
14
  /**
14
15
  * Get a project by ID
15
16
  */
16
- get(id: string): Promise<ProjectDTO>;
17
+ get(id: string): Promise<Response<ProjectDTO>>;
17
18
  /**
18
19
  * Create a project
19
20
  */
20
- create(data: Partial<ProjectDTO>): Promise<ProjectDTO>;
21
+ create(data: Partial<ProjectDTO>): Promise<Response<ProjectDTO>>;
21
22
  /**
22
23
  * Update a project
23
24
  */
24
- update(id: string, data: Partial<ProjectDTO>): Promise<ProjectDTO>;
25
+ update(id: string, data: Partial<ProjectDTO>): Promise<Response<ProjectDTO>>;
25
26
  /**
26
27
  * Delete a project
27
28
  */
28
- delete(id: string): Promise<void>;
29
+ delete(id: string): Promise<Response<void>>;
29
30
  }
@@ -1,4 +1,5 @@
1
1
  import { HttpClient } from '../http/client';
2
+ import type { Response } from '../http/response';
2
3
  import { SuggestRequest, SuggestResponse } from '../types';
3
4
  /**
4
5
  * Search API
@@ -9,7 +10,7 @@ export declare class SearchAPI {
9
10
  /**
10
11
  * Unified search across skills, knowledge, and apps
11
12
  */
12
- suggest(params: Partial<SuggestRequest>): Promise<SuggestResponse>;
13
+ suggest(params: Partial<SuggestRequest>): Promise<Response<SuggestResponse>>;
13
14
  /**
14
15
  * Full-text search via Meilisearch
15
16
  */
@@ -17,5 +18,5 @@ export declare class SearchAPI {
17
18
  q: string;
18
19
  type?: string;
19
20
  limit?: number;
20
- }): Promise<unknown>;
21
+ }): Promise<Response<unknown>>;
21
22
  }
@@ -1,4 +1,5 @@
1
1
  import { HttpClient } from '../http/client';
2
+ import type { Response } from '../http/response';
2
3
  import { SecretDTO, SecretCreateRequest, CursorListRequest, CursorListResponse } from '../types';
3
4
  /**
4
5
  * Secrets API
@@ -9,21 +10,21 @@ export declare class SecretsAPI {
9
10
  /**
10
11
  * List secrets with cursor-based pagination
11
12
  */
12
- list(params?: Partial<CursorListRequest>): Promise<CursorListResponse<SecretDTO>>;
13
+ list(params?: Partial<CursorListRequest>): Promise<Response<CursorListResponse<SecretDTO>>>;
13
14
  /**
14
15
  * Create a secret
15
16
  */
16
- create(data: SecretCreateRequest): Promise<SecretDTO>;
17
+ create(data: SecretCreateRequest): Promise<Response<SecretDTO>>;
17
18
  /**
18
19
  * Update a secret
19
20
  */
20
- update(key: string, data: Partial<SecretCreateRequest>): Promise<SecretDTO>;
21
+ update(key: string, data: Partial<SecretCreateRequest>): Promise<Response<SecretDTO>>;
21
22
  /**
22
23
  * Delete a secret
23
24
  */
24
- delete(key: string): Promise<void>;
25
+ delete(key: string): Promise<Response<void>>;
25
26
  /**
26
27
  * Reveal a secret value
27
28
  */
28
- reveal(key: string): Promise<SecretDTO>;
29
+ reveal(key: string): Promise<Response<SecretDTO>>;
29
30
  }
@@ -2,6 +2,7 @@
2
2
  * Sessions API - namespaced session operations.
3
3
  */
4
4
  import { HttpClient } from '../http/client';
5
+ import type { Response } from '../http/response';
5
6
  import { AppSessionDTO } from '../types';
6
7
  /**
7
8
  * Sessions API for managing stateful worker leases.
@@ -35,13 +36,13 @@ export declare class SessionsAPI {
35
36
  * @returns Session information
36
37
  * @throws SessionNotFoundError if session doesn't exist
37
38
  */
38
- get(sessionId: string): Promise<AppSessionDTO>;
39
+ get(sessionId: string): Promise<Response<AppSessionDTO>>;
39
40
  /**
40
41
  * List all sessions for the current user/team.
41
42
  *
42
43
  * @returns List of session information
43
44
  */
44
- list(): Promise<AppSessionDTO[]>;
45
+ list(): Promise<Response<AppSessionDTO[]>>;
45
46
  /**
46
47
  * Extend session expiration time.
47
48
  *
@@ -53,14 +54,14 @@ export declare class SessionsAPI {
53
54
  * @throws SessionExpiredError if session has expired
54
55
  * @throws SessionEndedError if session was ended
55
56
  */
56
- keepalive(sessionId: string): Promise<AppSessionDTO>;
57
+ keepalive(sessionId: string): Promise<Response<AppSessionDTO>>;
57
58
  /**
58
59
  * End a session and release the worker.
59
60
  *
60
61
  * @param sessionId - The session ID
61
62
  * @throws SessionNotFoundError if session doesn't exist
62
63
  */
63
- end(sessionId: string): Promise<void>;
64
+ end(sessionId: string): Promise<Response<void>>;
64
65
  }
65
66
  /**
66
67
  * Create a new SessionsAPI instance.
@@ -43,8 +43,7 @@ export class SessionsAPI {
43
43
  * @returns List of session information
44
44
  */
45
45
  async list() {
46
- const data = await this.http.request('get', '/sessions');
47
- return data || [];
46
+ return this.http.request('get', '/sessions');
48
47
  }
49
48
  /**
50
49
  * Extend session expiration time.
@@ -67,7 +66,7 @@ export class SessionsAPI {
67
66
  * @throws SessionNotFoundError if session doesn't exist
68
67
  */
69
68
  async end(sessionId) {
70
- await this.http.request('delete', `/sessions/${sessionId}`);
69
+ return this.http.request('delete', `/sessions/${sessionId}`);
71
70
  }
72
71
  }
73
72
  /**