@cadenya/cadenya 0.78.1 → 0.79.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 (83) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +8 -8
  3. package/client.d.mts +11 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +11 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js +10 -1
  8. package/client.js.map +1 -1
  9. package/client.mjs +10 -1
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/account.d.mts +3 -1
  13. package/resources/account.d.mts.map +1 -1
  14. package/resources/account.d.ts +3 -1
  15. package/resources/account.d.ts.map +1 -1
  16. package/resources/account.js.map +1 -1
  17. package/resources/account.mjs.map +1 -1
  18. package/resources/api-keys/access.d.mts +2 -2
  19. package/resources/api-keys/access.d.mts.map +1 -1
  20. package/resources/api-keys/access.d.ts +2 -2
  21. package/resources/api-keys/access.d.ts.map +1 -1
  22. package/resources/index.d.mts +3 -2
  23. package/resources/index.d.mts.map +1 -1
  24. package/resources/index.d.ts +3 -2
  25. package/resources/index.d.ts.map +1 -1
  26. package/resources/index.js +4 -2
  27. package/resources/index.js.map +1 -1
  28. package/resources/index.mjs +2 -1
  29. package/resources/index.mjs.map +1 -1
  30. package/resources/profiles.d.mts +33 -0
  31. package/resources/profiles.d.mts.map +1 -0
  32. package/resources/profiles.d.ts +33 -0
  33. package/resources/profiles.d.ts.map +1 -0
  34. package/resources/profiles.js +25 -0
  35. package/resources/profiles.js.map +1 -0
  36. package/resources/profiles.mjs +21 -0
  37. package/resources/profiles.mjs.map +1 -0
  38. package/resources/workspaces/index.d.mts +3 -0
  39. package/resources/workspaces/index.d.mts.map +1 -0
  40. package/resources/workspaces/index.d.ts +3 -0
  41. package/resources/workspaces/index.d.ts.map +1 -0
  42. package/resources/workspaces/index.js +9 -0
  43. package/resources/workspaces/index.js.map +1 -0
  44. package/resources/workspaces/index.mjs +4 -0
  45. package/resources/workspaces/index.mjs.map +1 -0
  46. package/resources/workspaces/members.d.mts +49 -0
  47. package/resources/workspaces/members.d.mts.map +1 -0
  48. package/resources/workspaces/members.d.ts +49 -0
  49. package/resources/workspaces/members.d.ts.map +1 -0
  50. package/resources/workspaces/members.js +44 -0
  51. package/resources/workspaces/members.js.map +1 -0
  52. package/resources/workspaces/members.mjs +40 -0
  53. package/resources/workspaces/members.mjs.map +1 -0
  54. package/resources/workspaces/workspaces.d.mts +133 -0
  55. package/resources/workspaces/workspaces.d.mts.map +1 -0
  56. package/resources/workspaces/workspaces.d.ts +133 -0
  57. package/resources/workspaces/workspaces.d.ts.map +1 -0
  58. package/resources/workspaces/workspaces.js +62 -0
  59. package/resources/workspaces/workspaces.js.map +1 -0
  60. package/resources/workspaces/workspaces.mjs +57 -0
  61. package/resources/workspaces/workspaces.mjs.map +1 -0
  62. package/resources/workspaces.d.mts +1 -45
  63. package/resources/workspaces.d.mts.map +1 -1
  64. package/resources/workspaces.d.ts +1 -45
  65. package/resources/workspaces.d.ts.map +1 -1
  66. package/resources/workspaces.js +2 -23
  67. package/resources/workspaces.js.map +1 -1
  68. package/resources/workspaces.mjs +1 -21
  69. package/resources/workspaces.mjs.map +1 -1
  70. package/src/client.ts +22 -7
  71. package/src/resources/account.ts +4 -1
  72. package/src/resources/api-keys/access.ts +2 -2
  73. package/src/resources/index.ts +6 -1
  74. package/src/resources/profiles.ts +47 -0
  75. package/src/resources/workspaces/index.ts +13 -0
  76. package/src/resources/workspaces/members.ts +85 -0
  77. package/src/resources/workspaces/workspaces.ts +190 -0
  78. package/src/resources/workspaces.ts +1 -66
  79. package/src/version.ts +1 -1
  80. package/version.d.mts +1 -1
  81. package/version.d.ts +1 -1
  82. package/version.js +1 -1
  83. package/version.mjs +1 -1
@@ -1,46 +1,2 @@
1
- import { APIResource } from "../core/resource.js";
2
- import * as Shared from "./shared.js";
3
- import { APIPromise } from "../core/api-promise.js";
4
- import { CursorPagination, type CursorPaginationParams, PagePromise } from "../core/pagination.js";
5
- import { RequestOptions } from "../internal/request-options.js";
6
- /**
7
- * Manage workspaces within an account. Workspaces provide organizational
8
- * grouping and isolation for resources such as agents, tools, and API keys.
9
- */
10
- export declare class Workspaces extends APIResource {
11
- /**
12
- * Lists all workspaces for the current account
13
- */
14
- list(query?: WorkspaceListParams | null | undefined, options?: RequestOptions): PagePromise<WorkspacesCursorPagination, Workspace>;
15
- /**
16
- * Retrieves the workspace associated with the current API token. Useful for
17
- * workspace-scoped tokens to identify which workspace they belong to.
18
- */
19
- get(options?: RequestOptions): APIPromise<Workspace>;
20
- }
21
- export type WorkspacesCursorPagination = CursorPagination<Workspace>;
22
- export interface Workspace {
23
- /**
24
- * AccountResourceMetadata is used to represent a resource that is associated to an
25
- * account but not to a workspace.
26
- */
27
- metadata: Shared.AccountResourceMetadata;
28
- spec: WorkspaceSpec;
29
- }
30
- export interface WorkspaceSpec {
31
- description?: string;
32
- }
33
- export interface WorkspaceListParams extends CursorPaginationParams {
34
- /**
35
- * When set to true you may use more of your alloted API rate-limit
36
- */
37
- includeInfo?: boolean;
38
- /**
39
- * Sort order for results (asc or desc by creation time)
40
- */
41
- sortOrder?: string;
42
- }
43
- export declare namespace Workspaces {
44
- export { type Workspace as Workspace, type WorkspaceSpec as WorkspaceSpec, type WorkspacesCursorPagination as WorkspacesCursorPagination, type WorkspaceListParams as WorkspaceListParams, };
45
- }
1
+ export * from "./workspaces/index.js";
46
2
  //# sourceMappingURL=workspaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,MAAM,oBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,8BAA2B;AAChG,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D;;;GAGG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,0BAA0B,EAAE,SAAS,CAAC;IAIrD;;;OAGG;IACH,GAAG,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;CAGrD;AAED,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAErE,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC,uBAAuB,CAAC;IAEzC,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB;IACjE;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
1
+ {"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":"AAEA,sCAAmC"}
@@ -1,27 +1,6 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Workspaces = void 0;
5
- const resource_1 = require("../core/resource.js");
6
- const pagination_1 = require("../core/pagination.js");
7
- /**
8
- * Manage workspaces within an account. Workspaces provide organizational
9
- * grouping and isolation for resources such as agents, tools, and API keys.
10
- */
11
- class Workspaces extends resource_1.APIResource {
12
- /**
13
- * Lists all workspaces for the current account
14
- */
15
- list(query = {}, options) {
16
- return this._client.getAPIList('/v1/workspaces', (pagination_1.CursorPagination), { query, ...options });
17
- }
18
- /**
19
- * Retrieves the workspace associated with the current API token. Useful for
20
- * workspace-scoped tokens to identify which workspace they belong to.
21
- */
22
- get(options) {
23
- return this._client.get('/v1/workspaces/current', options);
24
- }
25
- }
26
- exports.Workspaces = Workspaces;
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./workspaces/index.js"), exports);
27
6
  //# sourceMappingURL=workspaces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAgG;AAGhG;;;GAGG;AACH,MAAa,UAAW,SAAQ,sBAAW;IACzC;;OAEG;IACH,IAAI,CACF,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAA,6BAA2B,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvG,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,OAAwB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;CACF;AAlBD,gCAkBC"}
1
+ {"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gEAAmC"}
@@ -1,23 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../core/resource.mjs";
3
- import { CursorPagination } from "../core/pagination.mjs";
4
- /**
5
- * Manage workspaces within an account. Workspaces provide organizational
6
- * grouping and isolation for resources such as agents, tools, and API keys.
7
- */
8
- export class Workspaces extends APIResource {
9
- /**
10
- * Lists all workspaces for the current account
11
- */
12
- list(query = {}, options) {
13
- return this._client.getAPIList('/v1/workspaces', (CursorPagination), { query, ...options });
14
- }
15
- /**
16
- * Retrieves the workspace associated with the current API token. Useful for
17
- * workspace-scoped tokens to identify which workspace they belong to.
18
- */
19
- get(options) {
20
- return this._client.get('/v1/workspaces/current', options);
21
- }
22
- }
2
+ export * from "./workspaces/index.mjs";
23
3
  //# sourceMappingURL=workspaces.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspaces.mjs","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,gBAAgB,EAA4C,+BAA2B;AAGhG;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACH,IAAI,CACF,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAA,gBAA2B,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvG,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,OAAwB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;CACF"}
1
+ {"version":3,"file":"workspaces.mjs","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,uCAAmC"}
package/src/client.ts CHANGED
@@ -37,6 +37,7 @@ import {
37
37
  Models,
38
38
  ModelsCursorPagination,
39
39
  } from './resources/models';
40
+ import { ProfileListParams, Profiles } from './resources/profiles';
40
41
  import {
41
42
  Search,
42
43
  SearchSearchToolsOrToolSetsParams,
@@ -63,13 +64,6 @@ import {
63
64
  WorkspaceSecrets,
64
65
  WorkspaceSecretsCursorPagination,
65
66
  } from './resources/workspace-secrets';
66
- import {
67
- Workspace,
68
- WorkspaceListParams,
69
- WorkspaceSpec,
70
- Workspaces,
71
- WorkspacesCursorPagination,
72
- } from './resources/workspaces';
73
67
  import {
74
68
  Agent,
75
69
  AgentCreateParams,
@@ -197,6 +191,15 @@ import {
197
191
  ToolSets,
198
192
  ToolSetsCursorPagination,
199
193
  } from './resources/tool-sets/tool-sets';
194
+ import {
195
+ Workspace,
196
+ WorkspaceCreateParams,
197
+ WorkspaceListParams,
198
+ WorkspaceMember,
199
+ WorkspaceSpec,
200
+ Workspaces,
201
+ WorkspacesCursorPagination,
202
+ } from './resources/workspaces/workspaces';
200
203
  import { type Fetch } from './internal/builtin-types';
201
204
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
202
205
  import { FinalRequestOptions, RequestOptions } from './internal/request-options';
@@ -946,6 +949,11 @@ export class Cadenya {
946
949
  * unit and contain one or more workspaces.
947
950
  */
948
951
  account: API.AccountResource = new API.AccountResource(this);
952
+ /**
953
+ * Read account profiles. Profiles are the account-level principals (users and
954
+ * API keys) that can be granted access to workspaces.
955
+ */
956
+ profiles: API.Profiles = new API.Profiles(this);
949
957
  /**
950
958
  * Manage AI agents within a workspace. Agents define AI behavior and tool access.
951
959
  */
@@ -988,6 +996,8 @@ export class Cadenya {
988
996
  /**
989
997
  * Manage workspaces within an account. Workspaces provide organizational
990
998
  * grouping and isolation for resources such as agents, tools, and API keys.
999
+ * Workspace creation, archival, and membership management require an account
1000
+ * administrator (a token whose profile holds the admin role).
991
1001
  */
992
1002
  workspaces: API.Workspaces = new API.Workspaces(this);
993
1003
  webhooks: API.Webhooks = new API.Webhooks(this);
@@ -1000,6 +1010,7 @@ export class Cadenya {
1000
1010
  }
1001
1011
 
1002
1012
  Cadenya.AccountResource = AccountResource;
1013
+ Cadenya.Profiles = Profiles;
1003
1014
  Cadenya.Agents = Agents;
1004
1015
  Cadenya.Objectives = Objectives;
1005
1016
  Cadenya.MemoryLayers = MemoryLayers;
@@ -1032,6 +1043,8 @@ export declare namespace Cadenya {
1032
1043
  type RotateWebhookSigningKeyResponse as RotateWebhookSigningKeyResponse,
1033
1044
  };
1034
1045
 
1046
+ export { Profiles as Profiles, type ProfileListParams as ProfileListParams };
1047
+
1035
1048
  export {
1036
1049
  Agents as Agents,
1037
1050
  type Agent as Agent,
@@ -1185,8 +1198,10 @@ export declare namespace Cadenya {
1185
1198
  export {
1186
1199
  Workspaces as Workspaces,
1187
1200
  type Workspace as Workspace,
1201
+ type WorkspaceMember as WorkspaceMember,
1188
1202
  type WorkspaceSpec as WorkspaceSpec,
1189
1203
  type WorkspacesCursorPagination as WorkspacesCursorPagination,
1204
+ type WorkspaceCreateParams as WorkspaceCreateParams,
1190
1205
  type WorkspaceListParams as WorkspaceListParams,
1191
1206
  };
1192
1207
 
@@ -2,9 +2,10 @@
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
4
  import * as Shared from './shared';
5
- import * as WorkspacesAPI from './workspaces';
6
5
  import * as APIKeysAPI from './api-keys/api-keys';
6
+ import * as WorkspacesAPI from './workspaces/workspaces';
7
7
  import { APIPromise } from '../core/api-promise';
8
+ import { CursorPagination } from '../core/pagination';
8
9
  import { RequestOptions } from '../internal/request-options';
9
10
 
10
11
  /**
@@ -28,6 +29,8 @@ export class AccountResource extends APIResource {
28
29
  }
29
30
  }
30
31
 
32
+ export type ProfilesCursorPagination = CursorPagination<Profile>;
33
+
31
34
  /**
32
35
  * An account, the top-level organizational unit. Contains workspaces and
33
36
  * account-wide settings such as the webhook signing secret.
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
- import * as WorkspacesAPI from '../workspaces';
5
- import { WorkspacesCursorPagination } from '../workspaces';
6
4
  import * as APIKeysAPI from './api-keys';
5
+ import * as WorkspacesAPI from '../workspaces/workspaces';
6
+ import { WorkspacesCursorPagination } from '../workspaces/workspaces';
7
7
  import { APIPromise } from '../../core/api-promise';
8
8
  import { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
9
9
  import { buildHeaders } from '../../internal/headers';
@@ -19,6 +19,7 @@ export {
19
19
  type Profile,
20
20
  type ProfileSpec,
21
21
  type RotateWebhookSigningKeyResponse,
22
+ type ProfilesCursorPagination,
22
23
  } from './account';
23
24
  export {
24
25
  Agents,
@@ -117,6 +118,7 @@ export {
117
118
  type ObjectiveContextWindowsCursorPagination,
118
119
  type ObjectiveListEventsResponsesCursorPagination,
119
120
  } from './objectives/objectives';
121
+ export { Profiles, type ProfileListParams } from './profiles';
120
122
  export {
121
123
  Search,
122
124
  type SearchSearchToolsOrToolSetsResponse,
@@ -175,7 +177,10 @@ export {
175
177
  export {
176
178
  Workspaces,
177
179
  type Workspace,
180
+ type WorkspaceMember,
178
181
  type WorkspaceSpec,
182
+ type WorkspaceCreateParams,
179
183
  type WorkspaceListParams,
180
184
  type WorkspacesCursorPagination,
181
- } from './workspaces';
185
+ type WorkspaceMembersCursorPagination,
186
+ } from './workspaces/workspaces';
@@ -0,0 +1,47 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as AccountAPI from './account';
5
+ import { ProfilesCursorPagination } from './account';
6
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from '../core/pagination';
7
+ import { RequestOptions } from '../internal/request-options';
8
+
9
+ /**
10
+ * Read account profiles. Profiles are the account-level principals (users and
11
+ * API keys) that can be granted access to workspaces.
12
+ */
13
+ export class Profiles extends APIResource {
14
+ /**
15
+ * Lists the profiles in the current account. Supports free-form search and a type
16
+ * filter, intended for member-picker UIs (e.g. choosing a profile to add to a
17
+ * workspace).
18
+ */
19
+ list(
20
+ query: ProfileListParams | null | undefined = {},
21
+ options?: RequestOptions,
22
+ ): PagePromise<ProfilesCursorPagination, AccountAPI.Profile> {
23
+ return this._client.getAPIList('/v1/profiles', CursorPagination<AccountAPI.Profile>, {
24
+ query,
25
+ ...options,
26
+ });
27
+ }
28
+ }
29
+
30
+ export interface ProfileListParams extends CursorPaginationParams {
31
+ /**
32
+ * Free-form search over profile name and email, for member-picker UIs.
33
+ */
34
+ query?: string;
35
+
36
+ /**
37
+ * Filter by profile type. Defaults to all types when unset; pass PROFILE_TYPE_USER
38
+ * to list only human users (e.g. for a member picker).
39
+ */
40
+ type?: 'PROFILE_TYPE_USER' | 'PROFILE_TYPE_API_KEY' | 'PROFILE_TYPE_SYSTEM';
41
+ }
42
+
43
+ export declare namespace Profiles {
44
+ export { type ProfileListParams as ProfileListParams };
45
+ }
46
+
47
+ export { type ProfilesCursorPagination };
@@ -0,0 +1,13 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Members, type MemberListParams, type MemberAddParams, type MemberRemoveParams } from './members';
4
+ export {
5
+ Workspaces,
6
+ type Workspace,
7
+ type WorkspaceMember,
8
+ type WorkspaceSpec,
9
+ type WorkspaceCreateParams,
10
+ type WorkspaceListParams,
11
+ type WorkspacesCursorPagination,
12
+ type WorkspaceMembersCursorPagination,
13
+ } from './workspaces';
@@ -0,0 +1,85 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as WorkspacesAPI from './workspaces';
5
+ import { WorkspaceMembersCursorPagination } from './workspaces';
6
+ import { APIPromise } from '../../core/api-promise';
7
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
8
+ import { buildHeaders } from '../../internal/headers';
9
+ import { RequestOptions } from '../../internal/request-options';
10
+ import { path } from '../../internal/utils/path';
11
+
12
+ /**
13
+ * Manage workspaces within an account. Workspaces provide organizational
14
+ * grouping and isolation for resources such as agents, tools, and API keys.
15
+ * Workspace creation, archival, and membership management require an account
16
+ * administrator (a token whose profile holds the admin role).
17
+ */
18
+ export class Members extends APIResource {
19
+ /**
20
+ * Lists the members (actors) of a workspace. Requires the admin role.
21
+ */
22
+ list(
23
+ workspaceID: string,
24
+ query: MemberListParams | null | undefined = {},
25
+ options?: RequestOptions,
26
+ ): PagePromise<WorkspaceMembersCursorPagination, WorkspacesAPI.WorkspaceMember> {
27
+ return this._client.getAPIList(
28
+ path`/v1/workspaces/${workspaceID}/members`,
29
+ CursorPagination<WorkspacesAPI.WorkspaceMember>,
30
+ { query, ...options },
31
+ );
32
+ }
33
+
34
+ /**
35
+ * Grants a profile access to the workspace by creating an actor that links the
36
+ * profile to the workspace. Idempotent — re-adding an active member is a no-op.
37
+ * Requires the admin role.
38
+ */
39
+ add(
40
+ workspaceID: string,
41
+ body: MemberAddParams,
42
+ options?: RequestOptions,
43
+ ): APIPromise<WorkspacesAPI.WorkspaceMember> {
44
+ return this._client.post(path`/v1/workspaces/${workspaceID}/members`, { body, ...options });
45
+ }
46
+
47
+ /**
48
+ * Revokes a member's access to the workspace by deactivating their actor. The
49
+ * member is immediately cut off; the underlying profile is not deleted. Requires
50
+ * the admin role.
51
+ */
52
+ remove(id: string, params: MemberRemoveParams, options?: RequestOptions): APIPromise<void> {
53
+ const { workspaceId } = params;
54
+ return this._client.delete(path`/v1/workspaces/${workspaceId}/members/${id}`, {
55
+ ...options,
56
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
57
+ });
58
+ }
59
+ }
60
+
61
+ export interface MemberListParams extends CursorPaginationParams {}
62
+
63
+ export interface MemberAddParams {
64
+ /**
65
+ * The existing account profile to add to the workspace.
66
+ */
67
+ profileId?: string;
68
+ }
69
+
70
+ export interface MemberRemoveParams {
71
+ /**
72
+ * The workspace to remove the member from (path).
73
+ */
74
+ workspaceId: string;
75
+ }
76
+
77
+ export declare namespace Members {
78
+ export {
79
+ type MemberListParams as MemberListParams,
80
+ type MemberAddParams as MemberAddParams,
81
+ type MemberRemoveParams as MemberRemoveParams,
82
+ };
83
+ }
84
+
85
+ export { type WorkspaceMembersCursorPagination };
@@ -0,0 +1,190 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as Shared from '../shared';
5
+ import * as MembersAPI from './members';
6
+ import { MemberAddParams, MemberListParams, MemberRemoveParams, Members } from './members';
7
+ import { APIPromise } from '../../core/api-promise';
8
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
9
+ import { buildHeaders } from '../../internal/headers';
10
+ import { RequestOptions } from '../../internal/request-options';
11
+ import { path } from '../../internal/utils/path';
12
+
13
+ /**
14
+ * Manage workspaces within an account. Workspaces provide organizational
15
+ * grouping and isolation for resources such as agents, tools, and API keys.
16
+ * Workspace creation, archival, and membership management require an account
17
+ * administrator (a token whose profile holds the admin role).
18
+ */
19
+ export class Workspaces extends APIResource {
20
+ members: MembersAPI.Members = new MembersAPI.Members(this._client);
21
+
22
+ /**
23
+ * Creates a new workspace in the current account. Requires the admin role.
24
+ */
25
+ create(body: WorkspaceCreateParams, options?: RequestOptions): APIPromise<Workspace> {
26
+ return this._client.post('/v1/workspaces', { body, ...options });
27
+ }
28
+
29
+ /**
30
+ * Retrieves a workspace by ID from the current account.
31
+ */
32
+ retrieve(id: string, options?: RequestOptions): APIPromise<Workspace> {
33
+ return this._client.get(path`/v1/workspaces/${id}`, options);
34
+ }
35
+
36
+ /**
37
+ * Lists all workspaces for the current account
38
+ */
39
+ list(
40
+ query: WorkspaceListParams | null | undefined = {},
41
+ options?: RequestOptions,
42
+ ): PagePromise<WorkspacesCursorPagination, Workspace> {
43
+ return this._client.getAPIList('/v1/workspaces', CursorPagination<Workspace>, { query, ...options });
44
+ }
45
+
46
+ /**
47
+ * Archives a workspace. This is a soft delete: the workspace is retained but any
48
+ * subsequent request scoped to it returns a permission error. Requires the admin
49
+ * role.
50
+ */
51
+ delete(id: string, options?: RequestOptions): APIPromise<void> {
52
+ return this._client.delete(path`/v1/workspaces/${id}`, {
53
+ ...options,
54
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
55
+ });
56
+ }
57
+
58
+ /**
59
+ * Retrieves the workspace associated with the current API token. Useful for
60
+ * workspace-scoped tokens to identify which workspace they belong to.
61
+ */
62
+ getCurrent(options?: RequestOptions): APIPromise<Workspace> {
63
+ return this._client.get('/v1/workspaces/current', options);
64
+ }
65
+ }
66
+
67
+ export type WorkspacesCursorPagination = CursorPagination<Workspace>;
68
+
69
+ export type WorkspaceMembersCursorPagination = CursorPagination<WorkspaceMember>;
70
+
71
+ export interface Workspace {
72
+ /**
73
+ * AccountResourceMetadata is used to represent a resource that is associated to an
74
+ * account but not to a workspace.
75
+ */
76
+ metadata: Shared.AccountResourceMetadata;
77
+
78
+ spec: WorkspaceSpec;
79
+
80
+ /**
81
+ * Lifecycle status of the workspace. Archived workspaces reject all requests
82
+ * scoped to them. Server-populated.
83
+ */
84
+ status?: 'STATUS_ENABLED' | 'STATUS_DISABLED' | 'STATUS_ARCHIVED';
85
+ }
86
+
87
+ /**
88
+ * A member of a workspace: the profile granted access plus the actor row that
89
+ * links it to the workspace. Returned by member list/add operations.
90
+ */
91
+ export interface WorkspaceMember {
92
+ /**
93
+ * The actor row linking the profile to the workspace (the junction record). This
94
+ * is the id used to remove the member.
95
+ */
96
+ actorId: string;
97
+
98
+ /**
99
+ * The account profile that has access to the workspace.
100
+ */
101
+ profileId: string;
102
+
103
+ /**
104
+ * When the member was added to the workspace.
105
+ */
106
+ addedAt?: string;
107
+
108
+ /**
109
+ * Email address of the member's profile.
110
+ */
111
+ email?: string;
112
+
113
+ /**
114
+ * Display name of the member's profile.
115
+ */
116
+ name?: string;
117
+ }
118
+
119
+ export interface WorkspaceSpec {
120
+ description?: string;
121
+ }
122
+
123
+ export interface WorkspaceCreateParams {
124
+ /**
125
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
126
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
127
+ * excluded since they are set by the server.
128
+ */
129
+ metadata: WorkspaceCreateParams.Metadata;
130
+
131
+ spec: WorkspaceSpec;
132
+ }
133
+
134
+ export namespace WorkspaceCreateParams {
135
+ /**
136
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
137
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
138
+ * excluded since they are set by the server.
139
+ */
140
+ export interface Metadata {
141
+ /**
142
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
143
+ * Workspace")
144
+ */
145
+ name: string;
146
+
147
+ /**
148
+ * External ID for the resource (e.g., a workflow ID from an external system)
149
+ */
150
+ externalId?: string;
151
+
152
+ /**
153
+ * Arbitrary key-value pairs for categorization and filtering Examples:
154
+ * {"environment": "production", "team": "platform", "version": "v2"}
155
+ */
156
+ labels?: { [key: string]: string };
157
+ }
158
+ }
159
+
160
+ export interface WorkspaceListParams extends CursorPaginationParams {
161
+ /**
162
+ * When set to true you may use more of your alloted API rate-limit
163
+ */
164
+ includeInfo?: boolean;
165
+
166
+ /**
167
+ * Sort order for results (asc or desc by creation time)
168
+ */
169
+ sortOrder?: string;
170
+ }
171
+
172
+ Workspaces.Members = Members;
173
+
174
+ export declare namespace Workspaces {
175
+ export {
176
+ type Workspace as Workspace,
177
+ type WorkspaceMember as WorkspaceMember,
178
+ type WorkspaceSpec as WorkspaceSpec,
179
+ type WorkspacesCursorPagination as WorkspacesCursorPagination,
180
+ type WorkspaceCreateParams as WorkspaceCreateParams,
181
+ type WorkspaceListParams as WorkspaceListParams,
182
+ };
183
+
184
+ export {
185
+ Members as Members,
186
+ type MemberListParams as MemberListParams,
187
+ type MemberAddParams as MemberAddParams,
188
+ type MemberRemoveParams as MemberRemoveParams,
189
+ };
190
+ }
@@ -1,68 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../core/resource';
4
- import * as Shared from './shared';
5
- import { APIPromise } from '../core/api-promise';
6
- import { CursorPagination, type CursorPaginationParams, PagePromise } from '../core/pagination';
7
- import { RequestOptions } from '../internal/request-options';
8
-
9
- /**
10
- * Manage workspaces within an account. Workspaces provide organizational
11
- * grouping and isolation for resources such as agents, tools, and API keys.
12
- */
13
- export class Workspaces extends APIResource {
14
- /**
15
- * Lists all workspaces for the current account
16
- */
17
- list(
18
- query: WorkspaceListParams | null | undefined = {},
19
- options?: RequestOptions,
20
- ): PagePromise<WorkspacesCursorPagination, Workspace> {
21
- return this._client.getAPIList('/v1/workspaces', CursorPagination<Workspace>, { query, ...options });
22
- }
23
-
24
- /**
25
- * Retrieves the workspace associated with the current API token. Useful for
26
- * workspace-scoped tokens to identify which workspace they belong to.
27
- */
28
- get(options?: RequestOptions): APIPromise<Workspace> {
29
- return this._client.get('/v1/workspaces/current', options);
30
- }
31
- }
32
-
33
- export type WorkspacesCursorPagination = CursorPagination<Workspace>;
34
-
35
- export interface Workspace {
36
- /**
37
- * AccountResourceMetadata is used to represent a resource that is associated to an
38
- * account but not to a workspace.
39
- */
40
- metadata: Shared.AccountResourceMetadata;
41
-
42
- spec: WorkspaceSpec;
43
- }
44
-
45
- export interface WorkspaceSpec {
46
- description?: string;
47
- }
48
-
49
- export interface WorkspaceListParams extends CursorPaginationParams {
50
- /**
51
- * When set to true you may use more of your alloted API rate-limit
52
- */
53
- includeInfo?: boolean;
54
-
55
- /**
56
- * Sort order for results (asc or desc by creation time)
57
- */
58
- sortOrder?: string;
59
- }
60
-
61
- export declare namespace Workspaces {
62
- export {
63
- type Workspace as Workspace,
64
- type WorkspaceSpec as WorkspaceSpec,
65
- type WorkspacesCursorPagination as WorkspacesCursorPagination,
66
- type WorkspaceListParams as WorkspaceListParams,
67
- };
68
- }
3
+ export * from './workspaces/index';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.78.1'; // x-release-please-version
1
+ export const VERSION = '0.79.0'; // x-release-please-version