@membranehq/sdk 0.18.1 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/bundle.d.ts +198 -9
  2. package/dist/bundle.js +1066 -765
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/dts/accessors/connections-accessors.d.ts +8 -1
  5. package/dist/dts/accessors/integrations-accessors.d.ts +7 -0
  6. package/dist/dts/agent/session.d.ts +3 -2
  7. package/dist/dts/agent/worker-contracts.d.ts +4 -0
  8. package/dist/dts/auth/auth-context-permissions.d.ts +2 -0
  9. package/dist/dts/client-tokens/types.d.ts +1 -1
  10. package/dist/dts/oauth/types.d.ts +1 -0
  11. package/dist/dts/oauth/types.test.d.ts +1 -0
  12. package/dist/dts/orgs/types.d.ts +4 -1
  13. package/dist/dts/validation/types.d.ts +1 -0
  14. package/dist/dts/workspace-elements/api/action-run-log-records-api.d.ts +32 -0
  15. package/dist/dts/workspace-elements/api/actions-api.d.ts +34 -0
  16. package/dist/dts/workspace-elements/api/app-data-schema-instances-api.d.ts +1 -0
  17. package/dist/dts/workspace-elements/api/connections-api.d.ts +52 -6
  18. package/dist/dts/workspace-elements/api/data-link-table-instances-api.d.ts +11 -0
  19. package/dist/dts/workspace-elements/api/data-sources-api.d.ts +44 -0
  20. package/dist/dts/workspace-elements/api/external-api-logs-api.d.ts +10 -0
  21. package/dist/dts/workspace-elements/api/external-event-log-records-api.d.ts +10 -0
  22. package/dist/dts/workspace-elements/api/external-event-pulls-api.d.ts +10 -0
  23. package/dist/dts/workspace-elements/api/external-event-subscriptions-api.d.ts +10 -0
  24. package/dist/dts/workspace-elements/api/field-mappings-api.d.ts +50 -0
  25. package/dist/dts/workspace-elements/api/flow-runs-api.d.ts +26 -0
  26. package/dist/dts/workspace-elements/api/flows-api.d.ts +44 -0
  27. package/dist/dts/workspace-elements/api/incoming-webhooks-api.d.ts +10 -0
  28. package/dist/dts/workspace-elements/api/integrations-api.d.ts +10 -0
  29. package/dist/dts/workspace-elements/api/packages-api.d.ts +12 -4
  30. package/dist/dts/workspace-elements/base/action-instances/index.d.ts +3 -0
  31. package/dist/dts/workspace-elements/base/actions/index.d.ts +10 -0
  32. package/dist/dts/workspace-elements/base/connections/index.d.ts +27 -0
  33. package/dist/dts/workspace-elements/base/connectors/index.d.ts +1 -1
  34. package/dist/dts/workspace-elements/base/data-sources/index.d.ts +13 -0
  35. package/dist/dts/workspace-elements/base/field-mappings/index.d.ts +10 -0
  36. package/dist/dts/workspace-elements/base/flows/index.d.ts +10 -0
  37. package/dist/dts/workspace-elements/base/integrations/index.d.ts +1 -1
  38. package/dist/dts/workspace-elements/base/packages/index.d.ts +7 -2
  39. package/dist/dts/workspace-elements/types.d.ts +13 -0
  40. package/dist/dts/workspace-elements-catalog/index.d.ts +3 -0
  41. package/dist/dts/workspaces/types.d.ts +4 -0
  42. package/dist/index.browser.d.mts +567 -91
  43. package/dist/index.browser.d.ts +567 -91
  44. package/dist/index.browser.js +184 -103
  45. package/dist/index.browser.js.map +1 -1
  46. package/dist/index.browser.mjs +180 -104
  47. package/dist/index.browser.mjs.map +1 -1
  48. package/dist/index.node.d.mts +567 -91
  49. package/dist/index.node.d.ts +567 -91
  50. package/dist/index.node.js +184 -103
  51. package/dist/index.node.js.map +1 -1
  52. package/dist/index.node.mjs +180 -104
  53. package/dist/index.node.mjs.map +1 -1
  54. package/package.json +1 -1
@@ -3407,6 +3407,13 @@ function getFormula(value) {
3407
3407
  return undefined;
3408
3408
  }
3409
3409
 
3410
+ const zodDateCoercion = () => z.z.preprocess((val) => {
3411
+ if (val instanceof Date)
3412
+ return val.toISOString();
3413
+ if (typeof val === 'number')
3414
+ return new Date(val).toISOString();
3415
+ return val;
3416
+ }, z.z.string().transform((s) => new Date(s)));
3410
3417
  const zodBooleanCoercion = () => z.z.preprocess((val) => {
3411
3418
  if (typeof val === 'boolean')
3412
3419
  return val;
@@ -3424,8 +3431,8 @@ const zodBooleanCoercion = () => z.z.preprocess((val) => {
3424
3431
  }, z.z.boolean());
3425
3432
 
3426
3433
  const PaginationQuery = z.z.object({
3427
- limit: z.z.coerce.number().int().min(1).max(1000).optional(),
3428
- cursor: z.z.string().optional(),
3434
+ limit: z.z.coerce.number().int().min(1).max(1000).optional().describe('Maximum number of items to return (1-1000)'),
3435
+ cursor: z.z.string().optional().describe('Pagination cursor from a previous response'),
3429
3436
  });
3430
3437
  function createPaginationResponseSchema(itemSchema) {
3431
3438
  return z.z.object({
@@ -3439,7 +3446,7 @@ const IncludeArchivedQuery = z.z.object({
3439
3446
  includeArchived: zodBooleanCoercion().optional(),
3440
3447
  });
3441
3448
  const SearchQuery = z.z.object({
3442
- search: z.z.string().optional(),
3449
+ search: z.z.string().optional().describe('Text search query to filter results'),
3443
3450
  });
3444
3451
  const CommonListElementsQuery = SearchQuery.merge(PaginationQuery).merge(IncludeArchivedQuery);
3445
3452
  const CommonFindElementsQuery = CommonListElementsQuery;
@@ -3511,6 +3518,8 @@ exports.WorkspaceEventType = void 0;
3511
3518
  })(exports.WorkspaceEventType || (exports.WorkspaceEventType = {}));
3512
3519
  exports.WorkspaceElementState = void 0;
3513
3520
  (function (WorkspaceElementState) {
3521
+ WorkspaceElementState["BUILDING"] = "BUILDING";
3522
+ WorkspaceElementState["CLIENT_ACTION_REQUIRED"] = "CLIENT_ACTION_REQUIRED";
3514
3523
  WorkspaceElementState["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
3515
3524
  WorkspaceElementState["SETUP_FAILED"] = "SETUP_FAILED";
3516
3525
  WorkspaceElementState["READY"] = "READY";
@@ -3542,7 +3551,7 @@ const BaseMembraneInterfaceReadOnlyProperties = z.z.object({
3542
3551
  state: z.z
3543
3552
  .enum(exports.WorkspaceElementState)
3544
3553
  .optional()
3545
- .describe('Current lifecycle or health state (e.g. READY, SETUP_FAILED, CONFIGURATION_ERROR). Set by the engine during setup and validation.'),
3554
+ .describe('Current lifecycle or health state (e.g. READY, SETUP_FAILED, CONFIGURATION_ERROR, BUILDING). Set by the engine during setup and validation.'),
3546
3555
  errors: z.z.array(ErrorDataSchema).optional().describe('Validation or setup errors when state is not READY.'),
3547
3556
  revision: z.z
3548
3557
  .string()
@@ -3564,6 +3573,12 @@ const BaseMembraneInterfaceReadOnlyProperties = z.z.object({
3564
3573
  .describe('When true, the element cannot be modified (e.g. published package elements or elements from another workspace).'),
3565
3574
  });
3566
3575
  const BaseMembraneInterface = BaseWorkspaceElement.merge(BaseMembraneInterfaceEditableProperties).merge(BaseMembraneInterfaceReadOnlyProperties);
3576
+ const IntentProperties = z.z.object({
3577
+ intent: z.z
3578
+ .string()
3579
+ .optional()
3580
+ .describe('[Experimental] Intent-based instruction for an agent to configure this element.'),
3581
+ });
3567
3582
  const BaseIntegrationLevelMembraneInterfaceEditableProperties = BaseMembraneInterfaceEditableProperties.extend({
3568
3583
  integrationId: z.z
3569
3584
  .string()
@@ -3601,6 +3616,18 @@ const BaseIntegrationLevelMembraneInterfaceEditableProperties = BaseMembraneInte
3601
3616
  .boolean()
3602
3617
  .optional()
3603
3618
  .describe('When true, the element is universal (shared across all integrations). Requires universal-element access. Omit or false for integration-specific elements.'),
3619
+ externalAppId: z.z
3620
+ .string()
3621
+ .optional()
3622
+ .describe('Internal ID of the external app this element belongs to. Auto-populated from the integration when integrationId is set and the integration has an externalAppId.'),
3623
+ externalAppUuid: z.z
3624
+ .string()
3625
+ .optional()
3626
+ .describe('UUID of the external app; alternative to externalAppId when creating from export. Resolved to externalAppId by the API.'),
3627
+ externalAppKey: z.z
3628
+ .string()
3629
+ .optional()
3630
+ .describe('Key of the external app; alternative to externalAppId. Resolved to externalAppId by the API.'),
3604
3631
  });
3605
3632
  const BaseIntegrationLevelMembraneInterfaceReadOnlyProperties = BaseMembraneInterfaceReadOnlyProperties.extend({
3606
3633
  isCustomized: z.z.boolean().optional(),
@@ -3608,6 +3635,7 @@ const BaseIntegrationLevelMembraneInterfaceReadOnlyProperties = BaseMembraneInte
3608
3635
  const BaseIntegrationLevelMembraneInterfaceExportProperties = BaseMembraneInterfaceEditableProperties.extend({
3609
3636
  integrationUuid: z.z.string().optional(),
3610
3637
  parentUuid: z.z.string().optional(),
3638
+ externalAppUuid: z.z.string().optional(),
3611
3639
  isCustomized: z.z.boolean().optional(),
3612
3640
  isUniversal: z.z.boolean().optional(),
3613
3641
  });
@@ -3932,6 +3960,10 @@ const ActionExportProperties = BaseIntegrationLevelMembraneInterfaceExportProper
3932
3960
  });
3933
3961
  const ActionReadOnlyProperties = BaseIntegrationLevelMembraneInterfaceReadOnlyProperties.extend({
3934
3962
  ...TenantLayerElement.partial().shape,
3963
+ agentSessionId: z.z
3964
+ .string()
3965
+ .optional()
3966
+ .describe('[INTERNAL] ID of the agent session building this action. Present when the action was created or updated with an intent.'),
3935
3967
  universalParentId: z.z
3936
3968
  .string()
3937
3969
  .optional()
@@ -3993,12 +4025,25 @@ const ConnectionEditableProperties = z.z.object({
3993
4025
  name: z.z.string().optional(),
3994
4026
  meta: z.z.record(z.z.string(), z.z.any()).optional(),
3995
4027
  authOptionKey: z.z.string().optional(),
4028
+ integrationId: z.z.string().optional(),
4029
+ integrationUuid: z.z.string().optional(),
4030
+ integrationKey: z.z.string().optional(),
4031
+ connectorId: z.z.string().optional(),
4032
+ connectorUuid: z.z.string().optional(),
4033
+ connectorKey: z.z.string().optional(),
4034
+ connectorVersion: z.z.string().optional(),
3996
4035
  externalAppId: z.z.string().optional(),
3997
4036
  externalAppUuid: z.z.string().optional(),
3998
4037
  credentials: z.z.unknown().optional(),
3999
4038
  connectorParameters: z.z.unknown().optional(),
4000
4039
  input: z.z.unknown().optional(),
4001
4040
  });
4041
+ const ConnectionClientAction = z.z.object({
4042
+ type: z.z.enum(['connect', 'provide-input']),
4043
+ description: z.z.string(),
4044
+ uiUrl: z.z.string().optional(),
4045
+ agentInstructions: z.z.string().optional(),
4046
+ });
4002
4047
  const BaseConnection = BaseWorkspaceElement.extend({
4003
4048
  ...TenantLayerElement.shape,
4004
4049
  name: z.z.string(),
@@ -4023,6 +4068,11 @@ const BaseConnection = BaseWorkspaceElement.extend({
4023
4068
  archivedAt: z.z.string().optional(),
4024
4069
  isDeactivated: z.z.boolean().optional(),
4025
4070
  meta: z.z.record(z.z.string(), z.z.any()).optional(),
4071
+ agentSessionId: z.z
4072
+ .string()
4073
+ .optional()
4074
+ .describe('ID of the active agent session building this connection. Present when state is BUILDING.'),
4075
+ clientAction: ConnectionClientAction.optional().describe('Action the client must perform to advance this connection. Present if and only if state is CLIENT_ACTION_REQUIRED.'),
4026
4076
  });
4027
4077
  class ConnectionSpec {
4028
4078
  constructor(opts) {
@@ -8109,7 +8159,7 @@ const DataCollectionMethodCreate = {
8109
8159
  }),
8110
8160
  };
8111
8161
  },
8112
- getOutputSchema: ({}) => ({
8162
+ getOutputSchema: (_) => ({
8113
8163
  type: 'object',
8114
8164
  properties: {
8115
8165
  id: { type: 'string' },
@@ -8375,7 +8425,7 @@ const DataCollectionMethodUpdate = {
8375
8425
  }),
8376
8426
  };
8377
8427
  },
8378
- getOutputSchema: ({}) => ({
8428
+ getOutputSchema: (_) => ({
8379
8429
  type: 'object',
8380
8430
  properties: {
8381
8431
  id: { type: 'string' },
@@ -8392,7 +8442,7 @@ const GetEventConfig = {
8392
8442
  parameters: collection.parametersSchema,
8393
8443
  },
8394
8444
  }),
8395
- getOutputSchema: ({}) => ({
8445
+ getOutputSchema: (_) => ({
8396
8446
  type: 'object',
8397
8447
  properties: {
8398
8448
  eventKey: {
@@ -8411,7 +8461,7 @@ const GetEventConfig = {
8411
8461
  };
8412
8462
  const ExtractEventsMethod = {
8413
8463
  fileKey: 'connector-event-extract-events',
8414
- getInputSchema: ({}) => ({
8464
+ getInputSchema: (_) => ({
8415
8465
  type: 'object',
8416
8466
  properties: {
8417
8467
  events: {
@@ -8453,7 +8503,7 @@ const SubscribeMethod = {
8453
8503
  parameters: collection.parametersSchema,
8454
8504
  },
8455
8505
  }),
8456
- getOutputSchema: ({}) => ({}),
8506
+ getOutputSchema: (_) => ({}),
8457
8507
  supportedImplementationTypes: [exports.ConnectorMethodImplementationType.javascript],
8458
8508
  };
8459
8509
  const CollectEventsMethod = {
@@ -9879,7 +9929,6 @@ const PackageElementExport = z.z.object({
9879
9929
  });
9880
9930
  const PackageEditableProperties = BaseIntegrationLevelMembraneInterfaceEditableProperties.extend({
9881
9931
  scenarioTemplateId: z.z.string().optional(),
9882
- externalAppId: z.z.string().optional(),
9883
9932
  elements: z.z.array(PackageElement).optional(),
9884
9933
  });
9885
9934
  const PackageExportProperties = BaseIntegrationLevelMembraneInterfaceExportProperties.extend({
@@ -10231,12 +10280,12 @@ const FindActionsQuery = FindIntegrationLevelMembraneInterfaceQuery.extend({
10231
10280
  .optional()
10232
10281
  .meta({ hidden: true }),
10233
10282
  });
10234
- const CreateActionRequest = ActionEditableProperties;
10283
+ const CreateActionRequest = ActionEditableProperties.merge(IntentProperties);
10235
10284
  const UpdateActionRequest = CreateActionRequest.partial();
10236
10285
  const CreateActionInstanceRequest = CreateActionRequest;
10237
10286
  const UpdateActionInstanceRequest = UpdateActionRequest;
10238
10287
  const RunActionRequest = z.z.object({
10239
- input: z.z.any().optional(),
10288
+ input: z.z.any().optional().describe('Input data for the action, matching the action inputSchema'),
10240
10289
  meta: z.z.record(z.z.string(), z.z.any()).optional(),
10241
10290
  });
10242
10291
  const ActionRunResponse = z.z.object({
@@ -10329,6 +10378,7 @@ const FindConnectionsQuery = PaginationQuery.merge(SearchQuery)
10329
10378
  integrationId: z.z
10330
10379
  .string()
10331
10380
  .optional()
10381
+ .describe('Filter by integration ID')
10332
10382
  .meta({
10333
10383
  filterTitle: 'Integration',
10334
10384
  referenceElementType: exports.WorkspaceElementType.Integration,
@@ -10336,6 +10386,7 @@ const FindConnectionsQuery = PaginationQuery.merge(SearchQuery)
10336
10386
  connectorId: z.z
10337
10387
  .string()
10338
10388
  .optional()
10389
+ .describe('Filter by connector ID')
10339
10390
  .meta({
10340
10391
  filterTitle: 'Connector',
10341
10392
  }),
@@ -10374,20 +10425,24 @@ const FindConnectionsQuery = PaginationQuery.merge(SearchQuery)
10374
10425
  .optional()
10375
10426
  .meta({ hidden: true }),
10376
10427
  });
10377
- const CreateConnectionRequest = ConnectionEditableProperties.extend({
10378
- integrationId: z.z.string().optional(),
10379
- integrationUuid: z.z.string().optional(),
10380
- integrationKey: z.z.string().optional(),
10381
- connectorId: z.z.string().optional(),
10382
- connectorUuid: z.z.string().optional(),
10383
- connectorKey: z.z.string().optional(),
10384
- connectorVersion: z.z.string().optional(),
10428
+ const EnsureConnectionRequest = z.z.object({
10429
+ intent: z.z.string().min(1).max(200),
10430
+ name: z.z
10431
+ .string()
10432
+ .optional()
10433
+ .describe('Custom name for the connection. Only used when a new connection is created; ignored if an existing one is returned.'),
10385
10434
  });
10386
- const UpdateConnectionRequest = ConnectionEditableProperties;
10435
+ const CreateConnectionRequest = ConnectionEditableProperties.merge(IntentProperties);
10436
+ const UpdateConnectionRequest = ConnectionEditableProperties.merge(IntentProperties);
10387
10437
  const ConnectionExportProperties = ConnectionEditableProperties.omit({
10388
10438
  credentials: true,
10389
10439
  connectorParameters: true,
10390
10440
  input: true,
10441
+ integrationId: true,
10442
+ integrationKey: true,
10443
+ connectorId: true,
10444
+ connectorKey: true,
10445
+ connectorVersion: true,
10391
10446
  externalAppId: true,
10392
10447
  });
10393
10448
  const ConnectionTestResponse = z.z.object({
@@ -10940,7 +10995,7 @@ const FindDataLinkTableInstancesQuery = PaginationQuery.extend({
10940
10995
  .meta({
10941
10996
  filterTitle: 'Instance Key',
10942
10997
  }),
10943
- });
10998
+ }).merge(IncludeArchivedQuery);
10944
10999
  const FindDataLinksInTableQuery = PaginationQuery.extend({
10945
11000
  direction: z.z.enum(exports.DataLinkDirection).optional(),
10946
11001
  appRecordId: z.z.string().optional(),
@@ -11064,7 +11119,7 @@ const FindAppDataSchemaInstancesQuery = PaginationQuery.extend({
11064
11119
  .meta({
11065
11120
  filterTitle: 'Instance Key',
11066
11121
  }),
11067
- });
11122
+ }).merge(IncludeArchivedQuery);
11068
11123
  const AppDataSchemaInstanceApiResponse = BaseAppDataSchema.extend({
11069
11124
  user: BaseCustomer.optional(),
11070
11125
  appDataSchema: BaseAppDataSchema.optional(),
@@ -11713,6 +11768,82 @@ function getFilterFieldMeta(meta) {
11713
11768
  return undefined;
11714
11769
  }
11715
11770
 
11771
+ exports.AgentSessionStatus = void 0;
11772
+ (function (AgentSessionStatus) {
11773
+ AgentSessionStatus["QUEUED"] = "queued";
11774
+ AgentSessionStatus["STARTING"] = "starting";
11775
+ AgentSessionStatus["RUNNING"] = "running";
11776
+ AgentSessionStatus["COMPLETED"] = "completed";
11777
+ AgentSessionStatus["FAILED"] = "failed";
11778
+ AgentSessionStatus["CANCELLED"] = "cancelled";
11779
+ })(exports.AgentSessionStatus || (exports.AgentSessionStatus = {}));
11780
+ exports.AgentSessionState = void 0;
11781
+ (function (AgentSessionState) {
11782
+ AgentSessionState["BUSY"] = "busy";
11783
+ AgentSessionState["IDLE"] = "idle";
11784
+ })(exports.AgentSessionState || (exports.AgentSessionState = {}));
11785
+ exports.AgentName = void 0;
11786
+ (function (AgentName) {
11787
+ AgentName["MEMBRANE"] = "membrane";
11788
+ AgentName["MEMBRANE_CORE"] = "membrane-core";
11789
+ AgentName["SELF_INTEGRATING"] = "self-integrating";
11790
+ AgentName["CONNECTION_BUILDING"] = "connection-building";
11791
+ AgentName["ACTION_BUILDING"] = "action-building";
11792
+ AgentName["UNIVERSE"] = "universe";
11793
+ })(exports.AgentName || (exports.AgentName = {}));
11794
+ const AgentSession = z.z.object({
11795
+ ...TenantLayerElement.partial().shape,
11796
+ id: z.z.string(),
11797
+ workspaceId: z.z.string(),
11798
+ orgWorkspaceId: z.z.string().optional(),
11799
+ workspaceElementType: z.z.enum(exports.WorkspaceElementType),
11800
+ workspaceElementId: z.z.string(),
11801
+ type: z.z.string(),
11802
+ status: z.z.enum(exports.AgentSessionStatus),
11803
+ prompt: z.z.string(),
11804
+ error: ErrorDataSchema.optional(),
11805
+ lastActivityAt: z.z.iso
11806
+ .datetime()
11807
+ .describe('Last meaningful session progress timestamp used for inactivity timeout checks.'),
11808
+ title: z.z.string().optional(),
11809
+ summary: z.z.string().optional(),
11810
+ cost: z.z.number().optional(),
11811
+ state: z.z.enum(exports.AgentSessionState).default(exports.AgentSessionState.BUSY),
11812
+ usage: z.z.number().optional(),
11813
+ hasWorker: z.z.boolean(),
11814
+ isExternal: z.z.boolean().optional(),
11815
+ agentName: z.z.enum(exports.AgentName).optional(),
11816
+ output: z.z.record(z.z.string(), z.z.unknown()).optional(),
11817
+ createdAt: z.z.iso.datetime(),
11818
+ updatedAt: z.z.iso.datetime(),
11819
+ });
11820
+ const CreateAgentSession = z.z.object({
11821
+ workspaceElementType: z.z.enum(exports.WorkspaceElementType).optional(),
11822
+ workspaceElementId: z.z.string().min(1).optional(),
11823
+ prompt: z.z.string().min(1),
11824
+ testCustomerId: z.z.string().optional(),
11825
+ isExternal: z.z.boolean().optional(),
11826
+ modelId: z.z.string().optional(),
11827
+ agentName: z.z.enum(exports.AgentName).optional(),
11828
+ });
11829
+ const AgentSessionInputSchema = z.z.object({
11830
+ input: z.z.string().min(1),
11831
+ synthetic: z.z.boolean().optional(),
11832
+ });
11833
+ const PatchAgentSessionSchema = z.z.object({
11834
+ state: z.z.enum(exports.AgentSessionState).optional(),
11835
+ lastActivityAt: zodDateCoercion()
11836
+ .optional()
11837
+ .describe('Last meaningful session progress timestamp used for inactivity timeout checks.'),
11838
+ title: z.z.string().optional(),
11839
+ summary: z.z.string().optional(),
11840
+ cost: z.z.number().optional(),
11841
+ error: ErrorDataSchema.optional(),
11842
+ opencodeSessionUuid: z.z.string().optional(),
11843
+ output: z.z.record(z.z.string(), z.z.unknown()).optional(),
11844
+ status: z.z.enum(exports.AgentSessionStatus).optional(),
11845
+ });
11846
+
11716
11847
  const SYSTEM_FIELDS = ['updatedAt', 'createdAt', 'revision', '__v', '_id', 'id'];
11717
11848
  function jsonPointerToDotPath(pointer) {
11718
11849
  if (!pointer || pointer === '/')
@@ -11873,6 +12004,8 @@ const WorkspaceElementSpecs = {
11873
12004
  exportPropertiesSchema: ConnectionExportProperties,
11874
12005
  hasKey: false,
11875
12006
  hasUuid: false,
12007
+ isAgentic: true,
12008
+ agentName: exports.AgentName.CONNECTION_BUILDING,
11876
12009
  statsKey: 'connections',
11877
12010
  relatedIntegrationLayerElements: [
11878
12011
  exports.WorkspaceElementType.Action,
@@ -11927,6 +12060,7 @@ const WorkspaceElementSpecs = {
11927
12060
  namePlural: 'Actions',
11928
12061
  parentFieldKey: 'parentId',
11929
12062
  editablePropertiesSchema: ActionEditableProperties,
12063
+ backwardCompatibleEditablePropertiesSchema: CreateActionRequest,
11930
12064
  exportPropertiesSchema: ActionExportProperties,
11931
12065
  apiResponseSchema: ActionApiResponse,
11932
12066
  findQuerySchema: FindActionsQuery,
@@ -11936,6 +12070,8 @@ const WorkspaceElementSpecs = {
11936
12070
  hasParentChildRelationship: true,
11937
12071
  hasKey: true,
11938
12072
  hasPublicLayer: true,
12073
+ isAgentic: true,
12074
+ agentName: exports.AgentName.ACTION_BUILDING,
11939
12075
  statsKey: 'actions',
11940
12076
  },
11941
12077
  [exports.WorkspaceElementType.ActionRunLogRecord]: {
@@ -12259,6 +12395,7 @@ const OrgPermissionsSchema = z.z.object({
12259
12395
  const WorkspacePermissionsSchema = z.z.object({
12260
12396
  workspaceId: z.z.string().optional(),
12261
12397
  isWorkspaceManager: z.z.boolean(),
12398
+ isReadOnly: z.z.boolean().default(false),
12262
12399
  scopes: z.z.array(z.z.string()),
12263
12400
  });
12264
12401
  const TenantPermissionsSchema = z.z.object({
@@ -13074,6 +13211,7 @@ const WorkspaceSettingsSchema = z.object({
13074
13211
  enableActionRunLogs: z.boolean().optional(),
13075
13212
  disableSecretKeyAuth: z.boolean().optional(),
13076
13213
  useMembraneUniverse: z.boolean().optional(),
13214
+ useInlineAgent: z.boolean().optional(),
13077
13215
  });
13078
13216
  const EngineWorkspaceSettingsSchema = WorkspaceSettingsSchema;
13079
13217
  const WorkspacePublicKey = z.object({
@@ -13316,6 +13454,7 @@ exports.OrgUserRole = void 0;
13316
13454
  (function (OrgUserRole) {
13317
13455
  OrgUserRole["Admin"] = "admin";
13318
13456
  OrgUserRole["Member"] = "member";
13457
+ OrgUserRole["ReadOnly"] = "read-only";
13319
13458
  })(exports.OrgUserRole || (exports.OrgUserRole = {}));
13320
13459
  exports.OrgUserStatus = void 0;
13321
13460
  (function (OrgUserStatus) {
@@ -14729,7 +14868,7 @@ class ConnectionAccessor {
14729
14868
  onPopupClosed,
14730
14869
  });
14731
14870
  }
14732
- async openReconnectUI({} = {}) {
14871
+ async openReconnectUI(_options = {}) {
14733
14872
  const uri = await this.client.getEmbedUri(`connections/${this.connectionSelector}/refresh`);
14734
14873
  return new Promise((resolve) => {
14735
14874
  void openIframe(uri, {
@@ -15471,83 +15610,6 @@ const ScenarioTemplate = z.z.object({
15471
15610
  handyElements: z.z.array(HandyScenarioTemplateElement).optional(),
15472
15611
  });
15473
15612
 
15474
- exports.AgentSessionStatus = void 0;
15475
- (function (AgentSessionStatus) {
15476
- AgentSessionStatus["QUEUED"] = "queued";
15477
- AgentSessionStatus["STARTING"] = "starting";
15478
- AgentSessionStatus["RUNNING"] = "running";
15479
- AgentSessionStatus["COMPLETED"] = "completed";
15480
- AgentSessionStatus["FAILED"] = "failed";
15481
- AgentSessionStatus["CANCELLED"] = "cancelled";
15482
- })(exports.AgentSessionStatus || (exports.AgentSessionStatus = {}));
15483
- exports.AgentSessionState = void 0;
15484
- (function (AgentSessionState) {
15485
- AgentSessionState["BUSY"] = "busy";
15486
- AgentSessionState["IDLE"] = "idle";
15487
- })(exports.AgentSessionState || (exports.AgentSessionState = {}));
15488
- exports.AgentName = void 0;
15489
- (function (AgentName) {
15490
- AgentName["MEMBRANE"] = "membrane";
15491
- AgentName["MEMBRANE_CORE"] = "membrane-core";
15492
- AgentName["SELF_INTEGRATING"] = "self-integrating";
15493
- AgentName["CONNECTION_BUILDING"] = "connection-building";
15494
- AgentName["ACTION_BUILDING"] = "action-building";
15495
- AgentName["UNIVERSE"] = "universe";
15496
- })(exports.AgentName || (exports.AgentName = {}));
15497
- const AgentSession = z.z.object({
15498
- id: z.z.string(),
15499
- workspaceId: z.z.string(),
15500
- orgWorkspaceId: z.z.string().optional(),
15501
- userId: z.z.string().optional(),
15502
- workspaceElementType: z.z.enum(exports.WorkspaceElementType),
15503
- workspaceElementId: z.z.string(),
15504
- type: z.z.string(),
15505
- status: z.z.enum(exports.AgentSessionStatus),
15506
- prompt: z.z.string(),
15507
- error: ErrorDataSchema.optional(),
15508
- lastActivityAt: z.z.iso
15509
- .datetime()
15510
- .describe('Last meaningful session progress timestamp used for inactivity timeout checks.'),
15511
- title: z.z.string().optional(),
15512
- summary: z.z.string().optional(),
15513
- cost: z.z.number().optional(),
15514
- state: z.z.enum(exports.AgentSessionState).default(exports.AgentSessionState.BUSY),
15515
- usage: z.z.number().optional(),
15516
- hasWorker: z.z.boolean(),
15517
- isExternal: z.z.boolean().optional(),
15518
- agentName: z.z.enum(exports.AgentName).optional(),
15519
- output: z.z.record(z.z.string(), z.z.unknown()).optional(),
15520
- createdAt: z.z.iso.datetime(),
15521
- updatedAt: z.z.iso.datetime(),
15522
- });
15523
- const CreateAgentSession = z.z.object({
15524
- workspaceElementType: z.z.enum(exports.WorkspaceElementType).optional(),
15525
- workspaceElementId: z.z.string().min(1).optional(),
15526
- prompt: z.z.string().min(1),
15527
- testCustomerId: z.z.string().optional(),
15528
- isExternal: z.z.boolean().optional(),
15529
- modelId: z.z.string().optional(),
15530
- agentName: z.z.enum(exports.AgentName).optional(),
15531
- });
15532
- const AgentSessionInputSchema = z.z.object({
15533
- input: z.z.string().min(1),
15534
- synthetic: z.z.boolean().optional(),
15535
- });
15536
- const PatchAgentSessionSchema = z.z.object({
15537
- state: z.z.enum(exports.AgentSessionState).optional(),
15538
- lastActivityAt: z.z.iso
15539
- .datetime()
15540
- .optional()
15541
- .describe('Last meaningful session progress timestamp used for inactivity timeout checks.'),
15542
- title: z.z.string().optional(),
15543
- summary: z.z.string().optional(),
15544
- cost: z.z.number().optional(),
15545
- error: ErrorDataSchema.optional(),
15546
- opencodeSessionUuid: z.z.string().optional(),
15547
- output: z.z.record(z.z.string(), z.z.unknown()).optional(),
15548
- status: z.z.enum(exports.AgentSessionStatus).optional(),
15549
- });
15550
-
15551
15613
  const SessionCredentials = z.z.object({
15552
15614
  accessKeyId: z.z.string().min(1),
15553
15615
  secretAccessKey: z.z.string().min(1),
@@ -15567,6 +15629,7 @@ const SessionParameters = z.z.object({
15567
15629
  openRouterApiKey: z.z.string().optional(),
15568
15630
  modelId: z.z.string().optional(),
15569
15631
  agentName: z.z.enum(exports.AgentName).optional(),
15632
+ engine: z.z.enum(['opencode', 'inline']).optional(),
15570
15633
  });
15571
15634
 
15572
15635
  exports.AsyncRequestStatus = void 0;
@@ -15627,7 +15690,7 @@ const CreateClientTokenRequest = z.z.object({
15627
15690
  grantId: z.z.string(),
15628
15691
  grantName: z.z.string(),
15629
15692
  tenantId: z.z.string().optional(),
15630
- productKey: z.z.string().optional(),
15693
+ clientKey: z.z.string().optional(),
15631
15694
  });
15632
15695
  const ClientTokenListResponse = z.z.object({
15633
15696
  items: z.z.array(ClientToken),
@@ -15637,6 +15700,19 @@ const MEMBRANE_CLI_CLIENT_ID = 'membrane-cli';
15637
15700
  const OAUTH_SCOPE_PLATFORM_USER = 'platform-user';
15638
15701
  const OAUTH_SCOPE_TENANT = 'tenant';
15639
15702
  const OAUTH_SCOPES = [OAUTH_SCOPE_PLATFORM_USER, OAUTH_SCOPE_TENANT];
15703
+ const SCOPE_PRIORITY = [OAUTH_SCOPE_PLATFORM_USER, OAUTH_SCOPE_TENANT];
15704
+ function selectHighestPriorityScope(scopes) {
15705
+ if (scopes.length === 0)
15706
+ return undefined;
15707
+ if (scopes.length === 1)
15708
+ return scopes[0];
15709
+ for (const priorityScope of SCOPE_PRIORITY) {
15710
+ if (scopes.includes(priorityScope)) {
15711
+ return priorityScope;
15712
+ }
15713
+ }
15714
+ return scopes[0];
15715
+ }
15640
15716
  const OAuthTokenResponse = z.z.object({
15641
15717
  access_token: z.z.string(),
15642
15718
  token_type: z.z.string(),
@@ -15658,7 +15734,7 @@ const DbBackedCountsSchema = z.z.object({
15658
15734
  eventLogs: PendingQueueCountSchema.describe('Created external event log records in MongoDB.'),
15659
15735
  });
15660
15736
  const PendingTasksSummarySchema = z.z.object({
15661
- instant: PendingQueueCountSchema.optional().describe('Instant (BullMQ) queue counts.'),
15737
+ instant: PendingQueueCountSchema.optional().describe('Instant (MongoDB-backed) queue counts.'),
15662
15738
  queued: PendingQueueCountSchema.optional().describe('Slow (Redis-backed) queue counts.'),
15663
15739
  dbBacked: DbBackedCountsSchema.optional().describe('DB-backed job counts from MongoDB (source of truth).'),
15664
15740
  total: z.z.number().describe('Sum of available pending task counts. Excludes unavailable queues.'),
@@ -16250,6 +16326,7 @@ exports.ConnectedProductType = ConnectedProductType;
16250
16326
  exports.ConnectionAccessor = ConnectionAccessor;
16251
16327
  exports.ConnectionApiResponse = ConnectionApiResponse;
16252
16328
  exports.ConnectionApiResponseWithSecrets = ConnectionApiResponseWithSecrets;
16329
+ exports.ConnectionClientAction = ConnectionClientAction;
16253
16330
  exports.ConnectionDataCollectionAccessor = ConnectionDataCollectionAccessor;
16254
16331
  exports.ConnectionEditableProperties = ConnectionEditableProperties;
16255
16332
  exports.ConnectionError = ConnectionError;
@@ -16441,6 +16518,7 @@ exports.ElementListAccessor = ElementListAccessor;
16441
16518
  exports.ElementsExportFields = ElementsExportFields;
16442
16519
  exports.EngineCreditsProjectionResponse = EngineCreditsProjectionResponse;
16443
16520
  exports.EngineWorkspaceSettingsSchema = EngineWorkspaceSettingsSchema;
16521
+ exports.EnsureConnectionRequest = EnsureConnectionRequest;
16444
16522
  exports.ErrorData = ErrorData;
16445
16523
  exports.ErrorDataSchema = ErrorDataSchema;
16446
16524
  exports.Eval = Eval;
@@ -16568,6 +16646,7 @@ exports.IntegrationOptionConfig = IntegrationOptionConfig;
16568
16646
  exports.IntegrationOptions = IntegrationOptions;
16569
16647
  exports.IntegrationSpecificElementSelector = IntegrationSpecificElementSelector;
16570
16648
  exports.IntegrationsAccessor = IntegrationsAccessor;
16649
+ exports.IntentProperties = IntentProperties;
16571
16650
  exports.InternalError = InternalError;
16572
16651
  exports.InvalidLocatorError = InvalidLocatorError;
16573
16652
  exports.JavascriptFunction = JavascriptFunction;
@@ -16841,6 +16920,7 @@ exports.schemaIsNumber = schemaIsNumber;
16841
16920
  exports.schemaIsScalar = schemaIsScalar;
16842
16921
  exports.schemaTypeFromValue = schemaTypeFromValue;
16843
16922
  exports.schemaWithTitle = schemaWithTitle;
16923
+ exports.selectHighestPriorityScope = selectHighestPriorityScope;
16844
16924
  exports.setEditablePropertiesForWorkspaceElement = setEditablePropertiesForWorkspaceElement;
16845
16925
  exports.setSchemaAtLocator = setSchemaAtLocator;
16846
16926
  exports.setValueAtLocator = setValueAtLocator;
@@ -16858,4 +16938,5 @@ exports.valueToString = valueToString;
16858
16938
  exports.walkSchema = walkSchema;
16859
16939
  exports.wrapAnyOfSchema = wrapAnyOfSchema;
16860
16940
  exports.zodBooleanCoercion = zodBooleanCoercion;
16941
+ exports.zodDateCoercion = zodDateCoercion;
16861
16942
  //# sourceMappingURL=index.browser.js.map