@membranehq/sdk 0.28.3 → 0.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/bundle.d.ts +140 -4
  2. package/dist/bundle.js +1917 -1394
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/dts/accessors/connection-events-listener.d.ts +14 -0
  5. package/dist/dts/accessors/connection-events-listener.test.d.ts +1 -0
  6. package/dist/dts/accessors/connections-accessors.d.ts +9 -1
  7. package/dist/dts/accessors/integrations-accessors.d.ts +3 -0
  8. package/dist/dts/agent/harness-snapshot.d.ts +65 -0
  9. package/dist/dts/agent/harness.d.ts +107 -0
  10. package/dist/dts/agent/index.d.ts +6 -0
  11. package/dist/dts/agent/instruction.d.ts +32 -0
  12. package/dist/dts/agent/session.d.ts +6 -2
  13. package/dist/dts/agent/skill.d.ts +50 -0
  14. package/dist/dts/agent/tool.d.ts +8 -0
  15. package/dist/dts/agent/worker-contracts.d.ts +4 -1
  16. package/dist/dts/agent/workspace-element-context.d.ts +3 -0
  17. package/dist/dts/ai-gateway/models.d.ts +4 -0
  18. package/dist/dts/async-requests/types.d.ts +50 -0
  19. package/dist/dts/data-schema/types.d.ts +1 -1
  20. package/dist/dts/deprecation.d.ts +1 -0
  21. package/dist/dts/errors/index.d.ts +5 -1
  22. package/dist/dts/index.browser.d.ts +3 -1
  23. package/dist/dts/mcp-client/index.d.ts +76 -0
  24. package/dist/dts/oauth/types.d.ts +14 -5
  25. package/dist/dts/orgs/types.d.ts +1183 -33
  26. package/dist/dts/orgs/types.test.d.ts +1 -0
  27. package/dist/dts/platform-user-tokens/types.d.ts +42 -0
  28. package/dist/dts/scenario-templates/index.d.ts +1 -0
  29. package/dist/dts/workspace-elements/api/action-run-log-records-api.d.ts +50 -72
  30. package/dist/dts/workspace-elements/api/checkpoints-api.d.ts +1 -1
  31. package/dist/dts/workspace-elements/api/connections-api.d.ts +71 -1
  32. package/dist/dts/workspace-elements/api/connectors-api.d.ts +10 -0
  33. package/dist/dts/workspace-elements/api/data-link-table-instances-api.d.ts +10 -0
  34. package/dist/dts/workspace-elements/api/data-sources-api.d.ts +20 -0
  35. package/dist/dts/workspace-elements/api/external-api-logs-api.d.ts +10 -0
  36. package/dist/dts/workspace-elements/api/external-apps-api.d.ts +28 -0
  37. package/dist/dts/workspace-elements/api/external-event-log-records-api.d.ts +14 -0
  38. package/dist/dts/workspace-elements/api/external-event-pulls-api.d.ts +13 -0
  39. package/dist/dts/workspace-elements/api/external-event-subscriptions-api.d.ts +22 -0
  40. package/dist/dts/workspace-elements/api/external-event-types-api.d.ts +331 -0
  41. package/dist/dts/workspace-elements/api/field-mappings-api.d.ts +20 -0
  42. package/dist/dts/workspace-elements/api/flow-runs-api.d.ts +20 -0
  43. package/dist/dts/workspace-elements/api/flows-api.d.ts +20 -0
  44. package/dist/dts/workspace-elements/api/incoming-webhooks-api.d.ts +13 -0
  45. package/dist/dts/workspace-elements/api/index.d.ts +1 -0
  46. package/dist/dts/workspace-elements/api/integrations-api.d.ts +32 -7
  47. package/dist/dts/workspace-elements/base/action-run-log-records/index.d.ts +19 -0
  48. package/dist/dts/workspace-elements/base/actions/action-payload.d.ts +46 -0
  49. package/dist/dts/workspace-elements/base/actions/action-payload.test.d.ts +1 -0
  50. package/dist/dts/workspace-elements/base/actions/index.d.ts +3 -2
  51. package/dist/dts/workspace-elements/base/app-data-schemas/index.d.ts +2 -2
  52. package/dist/dts/workspace-elements/base/app-event-types/index.d.ts +2 -2
  53. package/dist/dts/workspace-elements/base/connection-requests/index.d.ts +6 -0
  54. package/dist/dts/workspace-elements/base/connections/index.d.ts +25 -0
  55. package/dist/dts/workspace-elements/base/connectors/auth.d.ts +6 -0
  56. package/dist/dts/workspace-elements/base/connectors/index.d.ts +213 -5
  57. package/dist/dts/workspace-elements/base/connectors/rest-api.d.ts +1 -0
  58. package/dist/dts/workspace-elements/base/data-link-tables/index.d.ts +2 -2
  59. package/dist/dts/workspace-elements/base/data-sources/index.d.ts +2 -2
  60. package/dist/dts/workspace-elements/base/external-event-log-records/index.d.ts +1 -0
  61. package/dist/dts/workspace-elements/base/external-event-pulls/index.d.ts +50 -0
  62. package/dist/dts/workspace-elements/base/external-event-subscriptions/index.d.ts +2 -0
  63. package/dist/dts/workspace-elements/base/external-event-types/index.d.ts +190 -0
  64. package/dist/dts/workspace-elements/base/field-mappings/index.d.ts +2 -2
  65. package/dist/dts/workspace-elements/base/flows/index.d.ts +2 -2
  66. package/dist/dts/workspace-elements/base/index.d.ts +1 -0
  67. package/dist/dts/workspace-elements/base/integrations/index.d.ts +2 -2
  68. package/dist/dts/workspace-elements/base/packages/index.d.ts +2 -2
  69. package/dist/dts/workspace-elements/paths.d.ts +1 -0
  70. package/dist/dts/workspace-elements/types.d.ts +15 -3
  71. package/dist/dts/workspace-tokens/index.d.ts +1 -0
  72. package/dist/dts/{client-tokens → workspace-tokens}/types.d.ts +35 -22
  73. package/dist/dts/workspaces/api.d.ts +0 -6
  74. package/dist/dts/workspaces/compare.d.ts +4 -1
  75. package/dist/index.browser.d.mts +3654 -858
  76. package/dist/index.browser.d.ts +3654 -858
  77. package/dist/index.browser.js +1105 -213
  78. package/dist/index.browser.js.map +1 -1
  79. package/dist/index.browser.mjs +1032 -207
  80. package/dist/index.browser.mjs.map +1 -1
  81. package/dist/index.node.d.mts +3654 -858
  82. package/dist/index.node.d.ts +3654 -858
  83. package/dist/index.node.js +1105 -213
  84. package/dist/index.node.js.map +1 -1
  85. package/dist/index.node.mjs +1032 -207
  86. package/dist/index.node.mjs.map +1 -1
  87. package/package.json +3 -3
  88. /package/dist/dts/{client-tokens → platform-user-tokens}/index.d.ts +0 -0
@@ -0,0 +1,14 @@
1
+ import { MembraneError } from '../errors';
2
+ import { ConnectionApiResponse } from '../workspace-elements/api';
3
+ export interface ConnectionEventHandlers {
4
+ onSuccess?: (connection: ConnectionApiResponse) => void;
5
+ onFailure?: (error: MembraneError) => void;
6
+ onTerminal?: () => void;
7
+ }
8
+ export declare function routeConnectionEventMessage(message: unknown, requestId: string, handlers: ConnectionEventHandlers): void;
9
+ export declare function createConnectionEventsSubscription(options: {
10
+ apiUri: string;
11
+ getToken: () => Promise<string> | string;
12
+ requestId: string;
13
+ handlers: ConnectionEventHandlers;
14
+ }): () => void;
@@ -1,7 +1,8 @@
1
1
  import { MembraneApiClient } from '../api-client';
2
2
  import { OpenConfigurationOptions } from '../iframe';
3
3
  import { InstanceKeyQuery } from '../integration-elements/common';
4
- import { ConnectionApiResponse, CreateConnectionRequest, FindConnectionsQuery, UpdateConnectionRequest } from '../workspace-elements/api/connections-api';
4
+ import { ConnectionApiResponse, CreateConnectionRequest, FindConnectionsQuery, LateConnectionEvents, UpdateConnectionRequest } from '../workspace-elements/api/connections-api';
5
+ import { ConnectionType } from '../workspace-elements/base/connections';
5
6
  import { OperationRunRequest, OperationRunResponse, OperationSpec } from '../workspace-elements/base/connectors/operations';
6
7
  import { DataCollectionSpec, DataCollectionCreateRequest, DataCollectionCreateResponse, DataCollectionDeleteRequest, DataCollectionDeleteResponse, DataCollectionFindByIdRequest, DataCollectionFindByIdResponse, DataCollectionListRequest, DataCollectionListResponse, DataCollectionMatchRequest, DataCollectionMatchResponse, DataCollectionSearchRequest, DataCollectionSearchResponse, DataCollectionUpdateRequest, DataCollectionUpdateResponse } from '../workspace-elements/base/data-collections';
7
8
  import { ConnectionLevelActionAccessor, ConnectionLevelActionsAccessor } from './actions-accessors';
@@ -31,6 +32,7 @@ export declare class ConnectionAccessor {
31
32
  patch(data: UpdateConnectionRequest): Promise<ConnectionApiResponse>;
32
33
  put(data: UpdateConnectionRequest): Promise<ConnectionApiResponse>;
33
34
  archive(): Promise<void>;
35
+ restore(): Promise<ConnectionApiResponse>;
34
36
  request(path: string, data?: any): Promise<any>;
35
37
  get proxy(): ConnectionProxy;
36
38
  operation(key: string): ConnectionOperationAccessor;
@@ -46,6 +48,7 @@ export declare class ConnectionAccessor {
46
48
  createdAt: string;
47
49
  updatedAt: string;
48
50
  userId: string;
51
+ type?: "connector" | "mcp" | undefined;
49
52
  key?: string | undefined;
50
53
  isTest?: boolean | undefined;
51
54
  connected?: boolean | undefined;
@@ -75,6 +78,8 @@ export declare class ConnectionAccessor {
75
78
  description: string;
76
79
  uiUrl?: string | undefined;
77
80
  agentInstructions?: string | undefined;
81
+ handoffAgentInstructions?: string | undefined;
82
+ reason?: "provide-input" | "authenticate" | "reauthenticate" | undefined;
78
83
  } | undefined;
79
84
  tenantId?: string | undefined;
80
85
  user?: {
@@ -173,6 +178,7 @@ export declare class ConnectionProxy {
173
178
  }
174
179
  export declare function createOrUpdateConnection(options: {
175
180
  client: MembraneApiClient;
181
+ type?: ConnectionType;
176
182
  authOptionKey?: string;
177
183
  name?: string;
178
184
  input?: any;
@@ -187,5 +193,7 @@ export declare function createOrUpdateConnection(options: {
187
193
  connectionRequestId?: string;
188
194
  apiUri: string;
189
195
  redirectUri?: string;
196
+ customState?: string;
190
197
  onPopupClosed?: () => void;
198
+ lateEvents?: LateConnectionEvents;
191
199
  }): Promise<ConnectionApiResponse | null>;
@@ -53,6 +53,7 @@ export declare class IntegrationAccessor extends ElementAccessor<IntegrationApiR
53
53
  createdAt: string;
54
54
  updatedAt: string;
55
55
  userId: string;
56
+ type?: "connector" | "mcp" | undefined;
56
57
  key?: string | undefined;
57
58
  isTest?: boolean | undefined;
58
59
  connected?: boolean | undefined;
@@ -82,6 +83,8 @@ export declare class IntegrationAccessor extends ElementAccessor<IntegrationApiR
82
83
  description: string;
83
84
  uiUrl?: string | undefined;
84
85
  agentInstructions?: string | undefined;
86
+ handoffAgentInstructions?: string | undefined;
87
+ reason?: "provide-input" | "authenticate" | "reauthenticate" | undefined;
85
88
  } | undefined;
86
89
  tenantId?: string | undefined;
87
90
  user?: {
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod';
2
+ export declare const AgentHarnessSnapshot: z.ZodObject<{
3
+ id: z.ZodString;
4
+ workspaceId: z.ZodString;
5
+ agentHarnessId: z.ZodString;
6
+ agentHarnessRevision: z.ZodOptional<z.ZodString>;
7
+ name: z.ZodString;
8
+ key: z.ZodString;
9
+ description: z.ZodOptional<z.ZodString>;
10
+ systemPrompt: z.ZodDefault<z.ZodString>;
11
+ defaultModel: z.ZodEnum<{
12
+ "anthropic/claude-sonnet-4.6": "anthropic/claude-sonnet-4.6";
13
+ "anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
14
+ "anthropic/claude-sonnet-4.5": "anthropic/claude-sonnet-4.5";
15
+ "anthropic/claude-opus-4.5": "anthropic/claude-opus-4.5";
16
+ "anthropic/claude-haiku-4.5": "anthropic/claude-haiku-4.5";
17
+ "openai/gpt-5.2": "openai/gpt-5.2";
18
+ "openai/gpt-5-nano": "openai/gpt-5-nano";
19
+ "google/gemini-3-pro-preview": "google/gemini-3-pro-preview";
20
+ "moonshotai/kimi-k2.5": "moonshotai/kimi-k2.5";
21
+ }>;
22
+ hash: z.ZodOptional<z.ZodString>;
23
+ toolIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
24
+ tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
25
+ id: z.ZodString;
26
+ name: z.ZodString;
27
+ description: z.ZodString;
28
+ enabledByDefault: z.ZodDefault<z.ZodBoolean>;
29
+ }, z.core.$strip>>>;
30
+ skillIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
31
+ skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
32
+ id: z.ZodString;
33
+ workspaceId: z.ZodString;
34
+ name: z.ZodString;
35
+ key: z.ZodString;
36
+ description: z.ZodString;
37
+ body: z.ZodString;
38
+ sourceUrl: z.ZodOptional<z.ZodURL>;
39
+ revision: z.ZodOptional<z.ZodString>;
40
+ archivedAt: z.ZodOptional<z.ZodISODateTime>;
41
+ createdAt: z.ZodOptional<z.ZodISODateTime>;
42
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
43
+ }, z.core.$strip>>>;
44
+ instructionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
45
+ instructions: z.ZodDefault<z.ZodArray<z.ZodObject<{
46
+ id: z.ZodString;
47
+ workspaceId: z.ZodString;
48
+ name: z.ZodString;
49
+ key: z.ZodString;
50
+ text: z.ZodString;
51
+ revision: z.ZodOptional<z.ZodString>;
52
+ archivedAt: z.ZodOptional<z.ZodISODateTime>;
53
+ createdAt: z.ZodOptional<z.ZodISODateTime>;
54
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
55
+ }, z.core.$strip>>>;
56
+ createdAt: z.ZodOptional<z.ZodISODateTime>;
57
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
58
+ }, z.core.$strip>;
59
+ export type AgentHarnessSnapshot = z.infer<typeof AgentHarnessSnapshot>;
60
+ export declare const FindAgentHarnessSnapshotQuery: z.ZodObject<{
61
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
62
+ cursor: z.ZodOptional<z.ZodString>;
63
+ agentHarnessId: z.ZodOptional<z.ZodString>;
64
+ }, z.core.$strip>;
65
+ export type FindAgentHarnessSnapshotQuery = z.infer<typeof FindAgentHarnessSnapshotQuery>;
@@ -0,0 +1,107 @@
1
+ import { z } from 'zod';
2
+ export declare const AgentHarness: z.ZodObject<{
3
+ id: z.ZodString;
4
+ workspaceId: z.ZodString;
5
+ name: z.ZodString;
6
+ key: z.ZodString;
7
+ description: z.ZodOptional<z.ZodString>;
8
+ systemPrompt: z.ZodOptional<z.ZodString>;
9
+ defaultModel: z.ZodEnum<{
10
+ "anthropic/claude-sonnet-4.6": "anthropic/claude-sonnet-4.6";
11
+ "anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
12
+ "anthropic/claude-sonnet-4.5": "anthropic/claude-sonnet-4.5";
13
+ "anthropic/claude-opus-4.5": "anthropic/claude-opus-4.5";
14
+ "anthropic/claude-haiku-4.5": "anthropic/claude-haiku-4.5";
15
+ "openai/gpt-5.2": "openai/gpt-5.2";
16
+ "openai/gpt-5-nano": "openai/gpt-5-nano";
17
+ "google/gemini-3-pro-preview": "google/gemini-3-pro-preview";
18
+ "moonshotai/kimi-k2.5": "moonshotai/kimi-k2.5";
19
+ }>;
20
+ toolIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
21
+ skillIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
22
+ instructionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
23
+ tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
24
+ id: z.ZodString;
25
+ name: z.ZodString;
26
+ description: z.ZodString;
27
+ enabledByDefault: z.ZodDefault<z.ZodBoolean>;
28
+ }, z.core.$strip>>>;
29
+ skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
30
+ id: z.ZodString;
31
+ workspaceId: z.ZodString;
32
+ name: z.ZodString;
33
+ key: z.ZodString;
34
+ description: z.ZodString;
35
+ body: z.ZodString;
36
+ sourceUrl: z.ZodOptional<z.ZodURL>;
37
+ revision: z.ZodOptional<z.ZodString>;
38
+ archivedAt: z.ZodOptional<z.ZodISODateTime>;
39
+ createdAt: z.ZodOptional<z.ZodISODateTime>;
40
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
41
+ }, z.core.$strip>>>;
42
+ instructions: z.ZodDefault<z.ZodArray<z.ZodObject<{
43
+ id: z.ZodString;
44
+ workspaceId: z.ZodString;
45
+ name: z.ZodString;
46
+ key: z.ZodString;
47
+ text: z.ZodString;
48
+ revision: z.ZodOptional<z.ZodString>;
49
+ archivedAt: z.ZodOptional<z.ZodISODateTime>;
50
+ createdAt: z.ZodOptional<z.ZodISODateTime>;
51
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
52
+ }, z.core.$strip>>>;
53
+ revision: z.ZodOptional<z.ZodString>;
54
+ archivedAt: z.ZodOptional<z.ZodISODateTime>;
55
+ createdAt: z.ZodOptional<z.ZodISODateTime>;
56
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
57
+ }, z.core.$strip>;
58
+ export type AgentHarness = z.infer<typeof AgentHarness>;
59
+ export declare const CreateAgentHarnessRequest: z.ZodObject<{
60
+ name: z.ZodString;
61
+ key: z.ZodOptional<z.ZodString>;
62
+ description: z.ZodOptional<z.ZodString>;
63
+ systemPrompt: z.ZodOptional<z.ZodString>;
64
+ defaultModel: z.ZodEnum<{
65
+ "anthropic/claude-sonnet-4.6": "anthropic/claude-sonnet-4.6";
66
+ "anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
67
+ "anthropic/claude-sonnet-4.5": "anthropic/claude-sonnet-4.5";
68
+ "anthropic/claude-opus-4.5": "anthropic/claude-opus-4.5";
69
+ "anthropic/claude-haiku-4.5": "anthropic/claude-haiku-4.5";
70
+ "openai/gpt-5.2": "openai/gpt-5.2";
71
+ "openai/gpt-5-nano": "openai/gpt-5-nano";
72
+ "google/gemini-3-pro-preview": "google/gemini-3-pro-preview";
73
+ "moonshotai/kimi-k2.5": "moonshotai/kimi-k2.5";
74
+ }>;
75
+ toolIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
76
+ skillIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
77
+ instructionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
78
+ }, z.core.$strip>;
79
+ export type CreateAgentHarnessRequest = z.infer<typeof CreateAgentHarnessRequest>;
80
+ export declare const UpdateAgentHarnessRequest: z.ZodObject<{
81
+ name: z.ZodOptional<z.ZodString>;
82
+ key: z.ZodOptional<z.ZodOptional<z.ZodString>>;
83
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
84
+ systemPrompt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
85
+ defaultModel: z.ZodOptional<z.ZodEnum<{
86
+ "anthropic/claude-sonnet-4.6": "anthropic/claude-sonnet-4.6";
87
+ "anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
88
+ "anthropic/claude-sonnet-4.5": "anthropic/claude-sonnet-4.5";
89
+ "anthropic/claude-opus-4.5": "anthropic/claude-opus-4.5";
90
+ "anthropic/claude-haiku-4.5": "anthropic/claude-haiku-4.5";
91
+ "openai/gpt-5.2": "openai/gpt-5.2";
92
+ "openai/gpt-5-nano": "openai/gpt-5-nano";
93
+ "google/gemini-3-pro-preview": "google/gemini-3-pro-preview";
94
+ "moonshotai/kimi-k2.5": "moonshotai/kimi-k2.5";
95
+ }>>;
96
+ toolIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
97
+ skillIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
98
+ instructionIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
99
+ }, z.core.$strip>;
100
+ export type UpdateAgentHarnessRequest = z.infer<typeof UpdateAgentHarnessRequest>;
101
+ export declare const FindAgentHarnessQuery: z.ZodObject<{
102
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
103
+ cursor: z.ZodOptional<z.ZodString>;
104
+ search: z.ZodOptional<z.ZodString>;
105
+ includeArchived: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
106
+ }, z.core.$strip>;
107
+ export type FindAgentHarnessQuery = z.infer<typeof FindAgentHarnessQuery>;
@@ -1,3 +1,9 @@
1
+ export * from './harness';
2
+ export * from './harness-snapshot';
3
+ export * from './instruction';
1
4
  export * from './session';
5
+ export * from './skill';
6
+ export * from './tool';
2
7
  export * from './session-cost';
3
8
  export * from './worker-contracts';
9
+ export * from './workspace-element-context';
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ export declare const AgentInstruction: z.ZodObject<{
3
+ id: z.ZodString;
4
+ workspaceId: z.ZodString;
5
+ name: z.ZodString;
6
+ key: z.ZodString;
7
+ text: z.ZodString;
8
+ revision: z.ZodOptional<z.ZodString>;
9
+ archivedAt: z.ZodOptional<z.ZodISODateTime>;
10
+ createdAt: z.ZodOptional<z.ZodISODateTime>;
11
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
12
+ }, z.core.$strip>;
13
+ export type AgentInstruction = z.infer<typeof AgentInstruction>;
14
+ export declare const CreateAgentInstructionRequest: z.ZodObject<{
15
+ name: z.ZodString;
16
+ key: z.ZodOptional<z.ZodString>;
17
+ text: z.ZodString;
18
+ }, z.core.$strip>;
19
+ export type CreateAgentInstructionRequest = z.infer<typeof CreateAgentInstructionRequest>;
20
+ export declare const UpdateAgentInstructionRequest: z.ZodObject<{
21
+ name: z.ZodOptional<z.ZodString>;
22
+ key: z.ZodOptional<z.ZodOptional<z.ZodString>>;
23
+ text: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$strip>;
25
+ export type UpdateAgentInstructionRequest = z.infer<typeof UpdateAgentInstructionRequest>;
26
+ export declare const FindAgentInstructionQuery: z.ZodObject<{
27
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
28
+ cursor: z.ZodOptional<z.ZodString>;
29
+ search: z.ZodOptional<z.ZodString>;
30
+ includeArchived: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
31
+ }, z.core.$strip>;
32
+ export type FindAgentInstructionQuery = z.infer<typeof FindAgentInstructionQuery>;
@@ -26,8 +26,8 @@ export declare const AgentSession: z.ZodObject<{
26
26
  id: z.ZodString;
27
27
  workspaceId: z.ZodString;
28
28
  orgWorkspaceId: z.ZodOptional<z.ZodString>;
29
- workspaceElementType: z.ZodEnum<typeof WorkspaceElementType>;
30
- workspaceElementId: z.ZodString;
29
+ workspaceElementType: z.ZodOptional<z.ZodEnum<typeof WorkspaceElementType>>;
30
+ workspaceElementId: z.ZodOptional<z.ZodString>;
31
31
  type: z.ZodString;
32
32
  status: z.ZodEnum<typeof AgentSessionStatus>;
33
33
  prompt: z.ZodString;
@@ -40,6 +40,8 @@ export declare const AgentSession: z.ZodObject<{
40
40
  hasWorker: z.ZodBoolean;
41
41
  isExternal: z.ZodOptional<z.ZodBoolean>;
42
42
  agentName: z.ZodOptional<z.ZodEnum<typeof AgentName>>;
43
+ agentHarnessId: z.ZodOptional<z.ZodString>;
44
+ agentHarnessSnapshotId: z.ZodOptional<z.ZodString>;
43
45
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
44
46
  createdAt: z.ZodISODateTime;
45
47
  updatedAt: z.ZodISODateTime;
@@ -63,12 +65,14 @@ export declare const CreateAgentSession: z.ZodObject<{
63
65
  "anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
64
66
  "anthropic/claude-sonnet-4.5": "anthropic/claude-sonnet-4.5";
65
67
  "anthropic/claude-opus-4.5": "anthropic/claude-opus-4.5";
68
+ "anthropic/claude-haiku-4.5": "anthropic/claude-haiku-4.5";
66
69
  "openai/gpt-5.2": "openai/gpt-5.2";
67
70
  "openai/gpt-5-nano": "openai/gpt-5-nano";
68
71
  "google/gemini-3-pro-preview": "google/gemini-3-pro-preview";
69
72
  "moonshotai/kimi-k2.5": "moonshotai/kimi-k2.5";
70
73
  }>>;
71
74
  agentName: z.ZodOptional<z.ZodEnum<typeof AgentName>>;
75
+ agentHarnessId: z.ZodOptional<z.ZodString>;
72
76
  promptAttachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
73
77
  title: z.ZodString;
74
78
  data: z.ZodUnknown;
@@ -0,0 +1,50 @@
1
+ import { z } from 'zod';
2
+ export declare const AgentSkill: z.ZodObject<{
3
+ id: z.ZodString;
4
+ workspaceId: z.ZodString;
5
+ name: z.ZodString;
6
+ key: z.ZodString;
7
+ description: z.ZodString;
8
+ body: z.ZodString;
9
+ sourceUrl: z.ZodOptional<z.ZodURL>;
10
+ revision: z.ZodOptional<z.ZodString>;
11
+ archivedAt: z.ZodOptional<z.ZodISODateTime>;
12
+ createdAt: z.ZodOptional<z.ZodISODateTime>;
13
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
14
+ }, z.core.$strip>;
15
+ export type AgentSkill = z.infer<typeof AgentSkill>;
16
+ export declare const CreateAgentSkillRequest: z.ZodObject<{
17
+ name: z.ZodString;
18
+ key: z.ZodOptional<z.ZodString>;
19
+ description: z.ZodString;
20
+ body: z.ZodString;
21
+ sourceUrl: z.ZodOptional<z.ZodURL>;
22
+ }, z.core.$strip>;
23
+ export type CreateAgentSkillRequest = z.infer<typeof CreateAgentSkillRequest>;
24
+ export declare const UpdateAgentSkillRequest: z.ZodObject<{
25
+ name: z.ZodOptional<z.ZodString>;
26
+ key: z.ZodOptional<z.ZodOptional<z.ZodString>>;
27
+ description: z.ZodOptional<z.ZodString>;
28
+ body: z.ZodOptional<z.ZodString>;
29
+ sourceUrl: z.ZodOptional<z.ZodOptional<z.ZodURL>>;
30
+ }, z.core.$strip>;
31
+ export type UpdateAgentSkillRequest = z.infer<typeof UpdateAgentSkillRequest>;
32
+ export declare const PreviewAgentSkillSourceRequest: z.ZodObject<{
33
+ sourceUrl: z.ZodURL;
34
+ }, z.core.$strip>;
35
+ export type PreviewAgentSkillSourceRequest = z.infer<typeof PreviewAgentSkillSourceRequest>;
36
+ export declare const PreviewAgentSkillSourceResponse: z.ZodObject<{
37
+ name: z.ZodString;
38
+ key: z.ZodOptional<z.ZodString>;
39
+ description: z.ZodString;
40
+ body: z.ZodString;
41
+ sourceUrl: z.ZodURL;
42
+ }, z.core.$strip>;
43
+ export type PreviewAgentSkillSourceResponse = z.infer<typeof PreviewAgentSkillSourceResponse>;
44
+ export declare const FindAgentSkillQuery: z.ZodObject<{
45
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
46
+ cursor: z.ZodOptional<z.ZodString>;
47
+ search: z.ZodOptional<z.ZodString>;
48
+ includeArchived: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
49
+ }, z.core.$strip>;
50
+ export type FindAgentSkillQuery = z.infer<typeof FindAgentSkillQuery>;
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ export declare const AgentTool: z.ZodObject<{
3
+ id: z.ZodString;
4
+ name: z.ZodString;
5
+ description: z.ZodString;
6
+ enabledByDefault: z.ZodDefault<z.ZodBoolean>;
7
+ }, z.core.$strip>;
8
+ export type AgentTool = z.infer<typeof AgentTool>;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { WorkspaceElementType } from '../workspace-elements';
2
3
  import { AgentName } from './session';
3
4
  export declare const SessionCredentials: z.ZodObject<{
4
5
  accessKeyId: z.ZodString;
@@ -7,6 +8,7 @@ export declare const SessionCredentials: z.ZodObject<{
7
8
  }, z.core.$strip>;
8
9
  export declare const SessionParameters: z.ZodObject<{
9
10
  id: z.ZodOptional<z.ZodString>;
11
+ leaseId: z.ZodOptional<z.ZodString>;
10
12
  accessToken: z.ZodOptional<z.ZodString>;
11
13
  credentials: z.ZodOptional<z.ZodObject<{
12
14
  accessKeyId: z.ZodString;
@@ -15,7 +17,7 @@ export declare const SessionParameters: z.ZodObject<{
15
17
  }, z.core.$strip>>;
16
18
  apiUri: z.ZodOptional<z.ZodString>;
17
19
  prompt: z.ZodOptional<z.ZodString>;
18
- elementType: z.ZodOptional<z.ZodString>;
20
+ elementType: z.ZodOptional<z.ZodEnum<typeof WorkspaceElementType>>;
19
21
  elementId: z.ZodOptional<z.ZodString>;
20
22
  customerId: z.ZodOptional<z.ZodString>;
21
23
  opencodeSessionUuid: z.ZodOptional<z.ZodString>;
@@ -23,6 +25,7 @@ export declare const SessionParameters: z.ZodObject<{
23
25
  openRouterApiKey: z.ZodOptional<z.ZodString>;
24
26
  modelId: z.ZodOptional<z.ZodString>;
25
27
  agentName: z.ZodOptional<z.ZodEnum<typeof AgentName>>;
28
+ agentHarnessSnapshotId: z.ZodOptional<z.ZodString>;
26
29
  engine: z.ZodOptional<z.ZodEnum<{
27
30
  opencode: "opencode";
28
31
  inline: "inline";
@@ -0,0 +1,3 @@
1
+ import { WorkspaceElementType } from '../workspace-elements';
2
+ export declare const AGENT_WORKSPACE_ELEMENT_CONTEXT_TYPES: readonly [WorkspaceElementType.Integration, WorkspaceElementType.Connection, WorkspaceElementType.Action, WorkspaceElementType.Flow, WorkspaceElementType.DataSource, WorkspaceElementType.FieldMapping, WorkspaceElementType.DataLinkTable, WorkspaceElementType.AppDataSchema, WorkspaceElementType.AppEventType, WorkspaceElementType.ExternalEventType];
3
+ export declare function canFetchAgentWorkspaceElementContext(elementType: WorkspaceElementType | string | undefined): elementType is WorkspaceElementType;
@@ -11,6 +11,9 @@ export declare const AI_GATEWAY_SUPPORTED_MODELS: readonly [{
11
11
  }, {
12
12
  readonly id: "anthropic/claude-opus-4.5";
13
13
  readonly name: "Claude Opus 4.5";
14
+ }, {
15
+ readonly id: "anthropic/claude-haiku-4.5";
16
+ readonly name: "Claude Haiku 4.5";
14
17
  }, {
15
18
  readonly id: "openai/gpt-5.2";
16
19
  readonly name: "GPT-5.2";
@@ -30,6 +33,7 @@ export declare const AIGatewaySupportedModelIdSchema: z.ZodEnum<{
30
33
  "anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
31
34
  "anthropic/claude-sonnet-4.5": "anthropic/claude-sonnet-4.5";
32
35
  "anthropic/claude-opus-4.5": "anthropic/claude-opus-4.5";
36
+ "anthropic/claude-haiku-4.5": "anthropic/claude-haiku-4.5";
33
37
  "openai/gpt-5.2": "openai/gpt-5.2";
34
38
  "openai/gpt-5-nano": "openai/gpt-5-nano";
35
39
  "google/gemini-3-pro-preview": "google/gemini-3-pro-preview";
@@ -19,3 +19,53 @@ export declare const AsyncRequestTriggerResponse: z.ZodObject<{
19
19
  accessKey: z.ZodString;
20
20
  }, z.core.$strip>;
21
21
  export type AsyncRequestTriggerResponse = z.infer<typeof AsyncRequestTriggerResponse>;
22
+ export declare const ListableAsyncRequestType: z.ZodEnum<{
23
+ "export-workspace": "export-workspace";
24
+ "import-workspace": "import-workspace";
25
+ }>;
26
+ export type ListableAsyncRequestType = z.infer<typeof ListableAsyncRequestType>;
27
+ export declare const AsyncRequestStatusSchema: z.ZodEnum<typeof AsyncRequestStatus>;
28
+ export declare const AsyncRequest: z.ZodObject<{
29
+ id: z.ZodString;
30
+ requestType: z.ZodEnum<{
31
+ "export-workspace": "export-workspace";
32
+ "import-workspace": "import-workspace";
33
+ }>;
34
+ status: z.ZodEnum<typeof AsyncRequestStatus>;
35
+ progress: z.ZodOptional<z.ZodNumber>;
36
+ result: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
37
+ error: z.ZodOptional<z.ZodType<ErrorDataSchema, unknown, z.core.$ZodTypeInternals<ErrorDataSchema, unknown>>>;
38
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
39
+ createdAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>>;
40
+ startedAt: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>>>;
41
+ completedAt: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>>>;
42
+ }, z.core.$strip>;
43
+ export type AsyncRequest = z.infer<typeof AsyncRequest>;
44
+ export declare const ListAsyncRequestsQuery: z.ZodObject<{
45
+ requestType: z.ZodEnum<{
46
+ "export-workspace": "export-workspace";
47
+ "import-workspace": "import-workspace";
48
+ }>;
49
+ status: z.ZodOptional<z.ZodEnum<typeof AsyncRequestStatus>>;
50
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
51
+ cursor: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
52
+ }, z.core.$strip>;
53
+ export type ListAsyncRequestsQuery = z.infer<typeof ListAsyncRequestsQuery>;
54
+ export declare const ListAsyncRequestsResponse: z.ZodObject<{
55
+ items: z.ZodArray<z.ZodObject<{
56
+ id: z.ZodString;
57
+ requestType: z.ZodEnum<{
58
+ "export-workspace": "export-workspace";
59
+ "import-workspace": "import-workspace";
60
+ }>;
61
+ status: z.ZodEnum<typeof AsyncRequestStatus>;
62
+ progress: z.ZodOptional<z.ZodNumber>;
63
+ result: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
64
+ error: z.ZodOptional<z.ZodType<ErrorDataSchema, unknown, z.core.$ZodTypeInternals<ErrorDataSchema, unknown>>>;
65
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
66
+ createdAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>>;
67
+ startedAt: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>>>;
68
+ completedAt: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>>>;
69
+ }, z.core.$strip>>;
70
+ }, z.core.$strip>;
71
+ export type ListAsyncRequestsResponse = z.infer<typeof ListAsyncRequestsResponse>;
@@ -9,7 +9,7 @@ export interface DataSchema {
9
9
  };
10
10
  items?: DataSchema;
11
11
  additionalProperties?: boolean | DataSchema;
12
- enum?: string[];
12
+ enum?: (string | number)[];
13
13
  referenceRecords?: any[];
14
14
  referenceCollection?: {
15
15
  key?: any;
@@ -0,0 +1 @@
1
+ export declare function warnDeprecatedOnce(key: string, message: string): void;
@@ -20,7 +20,8 @@ export declare enum BadRequestErrorKey {
20
20
  NOT_AUTHENTICATED = "not_authenticated",
21
21
  ACCESS_DENIED = "access_denied",
22
22
  ALREADY_EXISTS = "already_exists",
23
- RATE_LIMIT_EXCEEDED = "rate_limit_exceeded"
23
+ RATE_LIMIT_EXCEEDED = "rate_limit_exceeded",
24
+ WORKSPACE_TIER_GATED = "workspace_tier_gated"
24
25
  }
25
26
  export declare enum ConnectionErrorKey {
26
27
  CONNECTION_IS_DEFUNCT = "connection_is_defunct",
@@ -96,6 +97,9 @@ export declare class NotAuthenticatedError extends BadRequestError {
96
97
  export declare class AccessDeniedError extends BadRequestError {
97
98
  constructor(arg: ErrorConstructorArg);
98
99
  }
100
+ export declare class RemoteConnectorCodeUnavailableError extends BadRequestError {
101
+ constructor(arg?: ErrorConstructorArg);
102
+ }
99
103
  export declare class CustomCodeError extends MembraneError {
100
104
  constructor(arg: ErrorConstructorArg);
101
105
  }
@@ -36,7 +36,9 @@ export * from './functions';
36
36
  export * from './dto';
37
37
  export * from './async-requests';
38
38
  export * from './self-hosting-tokens';
39
- export * from './client-tokens';
39
+ export * from './platform-user-tokens';
40
+ export * from './mcp-client';
41
+ export * from './workspace-tokens';
40
42
  export * from './oauth';
41
43
  export * from './console-paths';
42
44
  export * from './pending-tasks';
@@ -0,0 +1,76 @@
1
+ import { z } from 'zod';
2
+ export declare const MCP_PROTOCOL_VERSION = "2025-11-25";
3
+ export declare const McpConnectionInput: z.ZodObject<{
4
+ mcpServerUrl: z.ZodOptional<z.ZodString>;
5
+ }, z.core.$strip>;
6
+ export type McpConnectionInput = z.infer<typeof McpConnectionInput>;
7
+ export declare const ProtectedResourceMetadata: z.ZodObject<{
8
+ resource: z.ZodString;
9
+ authorization_servers: z.ZodArray<z.ZodString>;
10
+ bearer_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
11
+ scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ }, z.core.$strip>;
13
+ export type ProtectedResourceMetadata = z.infer<typeof ProtectedResourceMetadata>;
14
+ export declare const AuthorizationServerMetadata: z.ZodObject<{
15
+ issuer: z.ZodString;
16
+ authorization_endpoint: z.ZodString;
17
+ token_endpoint: z.ZodString;
18
+ registration_endpoint: z.ZodOptional<z.ZodString>;
19
+ scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
20
+ response_types_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
+ grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
+ code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
23
+ token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
24
+ client_id_metadata_document_supported: z.ZodOptional<z.ZodBoolean>;
25
+ }, z.core.$loose>;
26
+ export type AuthorizationServerMetadata = z.infer<typeof AuthorizationServerMetadata>;
27
+ export declare const DynamicClientRegistrationResponse: z.ZodObject<{
28
+ client_id: z.ZodString;
29
+ client_secret: z.ZodOptional<z.ZodString>;
30
+ client_id_issued_at: z.ZodOptional<z.ZodNumber>;
31
+ client_secret_expires_at: z.ZodOptional<z.ZodNumber>;
32
+ registration_access_token: z.ZodOptional<z.ZodString>;
33
+ registration_client_uri: z.ZodOptional<z.ZodString>;
34
+ }, z.core.$loose>;
35
+ export type DynamicClientRegistrationResponse = z.infer<typeof DynamicClientRegistrationResponse>;
36
+ export declare const McpTokenResponse: z.ZodObject<{
37
+ access_token: z.ZodString;
38
+ token_type: z.ZodString;
39
+ expires_in: z.ZodOptional<z.ZodNumber>;
40
+ refresh_token: z.ZodOptional<z.ZodString>;
41
+ scope: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$loose>;
43
+ export type McpTokenResponse = z.infer<typeof McpTokenResponse>;
44
+ export declare const McpTool: z.ZodObject<{
45
+ name: z.ZodString;
46
+ description: z.ZodOptional<z.ZodString>;
47
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
48
+ }, z.core.$loose>;
49
+ export type McpTool = z.infer<typeof McpTool>;
50
+ export declare const McpSynthesizedAction: z.ZodObject<{
51
+ mcp: z.ZodLiteral<true>;
52
+ id: z.ZodString;
53
+ connectionId: z.ZodString;
54
+ key: z.ZodString;
55
+ name: z.ZodString;
56
+ description: z.ZodOptional<z.ZodString>;
57
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
58
+ isReadOnly: z.ZodLiteral<true>;
59
+ }, z.core.$strip>;
60
+ export type McpSynthesizedAction = z.infer<typeof McpSynthesizedAction>;
61
+ export declare const McpAuthState: z.ZodObject<{
62
+ asIssuer: z.ZodString;
63
+ tokenEndpoint: z.ZodString;
64
+ clientId: z.ZodString;
65
+ clientSecret: z.ZodOptional<z.ZodString>;
66
+ canonicalResource: z.ZodString;
67
+ scope: z.ZodOptional<z.ZodString>;
68
+ }, z.core.$strip>;
69
+ export type McpAuthState = z.infer<typeof McpAuthState>;
70
+ export declare const McpCredentials: z.ZodObject<{
71
+ accessToken: z.ZodString;
72
+ refreshToken: z.ZodOptional<z.ZodString>;
73
+ expiresAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
74
+ tokenType: z.ZodDefault<z.ZodString>;
75
+ }, z.core.$strip>;
76
+ export type McpCredentials = z.infer<typeof McpCredentials>;