@datalayer/core 0.0.27 → 1.0.2

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 (62) hide show
  1. package/lib/api/index.d.ts +1 -1
  2. package/lib/api/index.js +1 -1
  3. package/lib/api/spacer/index.d.ts +1 -2
  4. package/lib/api/spacer/index.js +1 -2
  5. package/lib/client/utils/spacerUtils.d.ts +2 -2
  6. package/lib/client/utils/spacerUtils.js +4 -4
  7. package/lib/components/avatars/BoringAvatar.d.ts +3 -1
  8. package/lib/components/avatars/BoringAvatar.js +15 -14
  9. package/lib/components/avatars/BoringAvatar.stories.d.ts +2 -1
  10. package/lib/components/storage/ContentsBrowser.d.ts +6 -0
  11. package/lib/components/storage/ContentsBrowser.js +9 -10
  12. package/lib/hooks/index.d.ts +2 -0
  13. package/lib/hooks/index.js +2 -0
  14. package/lib/hooks/useCache.d.ts +11 -32
  15. package/lib/hooks/useCache.js +54 -226
  16. package/lib/hooks/useProjectStore.d.ts +58 -0
  17. package/lib/hooks/useProjectStore.js +64 -0
  18. package/lib/hooks/useProjects.d.ts +590 -0
  19. package/lib/hooks/useProjects.js +166 -0
  20. package/lib/index.d.ts +0 -1
  21. package/lib/index.js +0 -2
  22. package/lib/models/CreditsDTO.d.ts +1 -1
  23. package/lib/models/CreditsDTO.js +1 -1
  24. package/lib/models/Datasource.d.ts +4 -4
  25. package/lib/models/Datasource.js +7 -7
  26. package/lib/models/EnvironmentDTO.d.ts +3 -3
  27. package/lib/models/EnvironmentDTO.js +3 -3
  28. package/lib/models/HealthCheck.d.ts +2 -2
  29. package/lib/models/HealthCheck.js +2 -2
  30. package/lib/models/ItemDTO.d.ts +3 -3
  31. package/lib/models/ItemDTO.js +10 -10
  32. package/lib/models/LexicalDTO.d.ts +3 -3
  33. package/lib/models/LexicalDTO.js +4 -4
  34. package/lib/models/NotebookDTO.d.ts +3 -3
  35. package/lib/models/NotebookDTO.js +6 -6
  36. package/lib/models/Page.d.ts +2 -0
  37. package/lib/models/RuntimeDTO.d.ts +4 -4
  38. package/lib/models/RuntimeDTO.js +9 -9
  39. package/lib/models/RuntimeSnapshotDTO.d.ts +3 -3
  40. package/lib/models/RuntimeSnapshotDTO.js +7 -7
  41. package/lib/models/Secret.d.ts +4 -4
  42. package/lib/models/Secret.js +7 -7
  43. package/lib/models/Space.js +3 -0
  44. package/lib/models/SpaceDTO.d.ts +3 -3
  45. package/lib/models/SpaceDTO.js +14 -14
  46. package/lib/models/UserDTO.d.ts +2 -2
  47. package/lib/models/UserDTO.js +2 -2
  48. package/lib/views/iam-tokens/Tokens.js +1 -1
  49. package/lib/views/secrets/Secrets.js +1 -1
  50. package/package.json +1 -1
  51. package/lib/api/spacer/agentSpaces.d.ts +0 -193
  52. package/lib/api/spacer/agentSpaces.js +0 -127
  53. package/lib/theme/DatalayerTheme.d.ts +0 -52
  54. package/lib/theme/DatalayerTheme.js +0 -228
  55. package/lib/theme/DatalayerThemeProvider.d.ts +0 -29
  56. package/lib/theme/DatalayerThemeProvider.js +0 -54
  57. package/lib/theme/Palette.d.ts +0 -4
  58. package/lib/theme/Palette.js +0 -10
  59. package/lib/theme/index.d.ts +0 -4
  60. package/lib/theme/index.js +0 -8
  61. package/lib/theme/useSystemColorMode.d.ts +0 -9
  62. package/lib/theme/useSystemColorMode.js +0 -26
@@ -16,17 +16,17 @@ import { validateJSON } from '../api/utils/validation';
16
16
  */
17
17
  export class RuntimeSnapshotDTO {
18
18
  _data;
19
- _sdk;
19
+ _client;
20
20
  _deleted = false;
21
21
  /**
22
22
  * Create a Runtime Snapshot instance.
23
23
  *
24
24
  * @param data - Snapshot data from API
25
- * @param sdk - Client instance
25
+ * @param client - Client instance
26
26
  */
27
- constructor(data, sdk) {
27
+ constructor(data, client) {
28
28
  this._data = data;
29
- this._sdk = sdk;
29
+ this._client = client;
30
30
  }
31
31
  // ========================================================================
32
32
  // Helper Methods
@@ -77,8 +77,8 @@ export class RuntimeSnapshotDTO {
77
77
  */
78
78
  async delete() {
79
79
  this._checkDeleted();
80
- const token = this._sdk.getToken();
81
- const runtimesRunUrl = this._sdk.getRuntimesRunUrl();
80
+ const token = this._client.getToken();
81
+ const runtimesRunUrl = this._client.getRuntimesRunUrl();
82
82
  await snapshots.deleteSnapshot(token, this.uid, runtimesRunUrl);
83
83
  this._deleted = true;
84
84
  }
@@ -90,7 +90,7 @@ export class RuntimeSnapshotDTO {
90
90
  */
91
91
  async restore(minutesLimit) {
92
92
  this._checkDeleted();
93
- return await this._sdk.createRuntime({
93
+ return await this._client.createRuntime({
94
94
  environmentName: this.environment,
95
95
  type: 'notebook',
96
96
  givenName: `Restored from ${this.name}`,
@@ -116,7 +116,7 @@ export interface DeleteSecretResponse {
116
116
  *
117
117
  * @example
118
118
  * ```typescript
119
- * const secret = await sdk.createSecret({
119
+ * const secret = await client.createSecret({
120
120
  * variant: 'password',
121
121
  * name: 'db_password',
122
122
  * description: 'Production DB password',
@@ -131,14 +131,14 @@ export interface DeleteSecretResponse {
131
131
  export declare class SecretDTO {
132
132
  /** @internal */
133
133
  _data: SecretData;
134
- private _sdk;
134
+ private _client;
135
135
  private _deleted;
136
136
  /**
137
137
  * Create a Secret instance.
138
138
  * @param data - Secret data from API
139
- * @param sdk - Client instance
139
+ * @param client - Client instance
140
140
  */
141
- constructor(data: SecretData, sdk: DatalayerClient);
141
+ constructor(data: SecretData, client: DatalayerClient);
142
142
  private _checkDeleted;
143
143
  private _decodeValue;
144
144
  get uid(): string;
@@ -21,7 +21,7 @@ import { validateJSON } from '../api/utils/validation';
21
21
  *
22
22
  * @example
23
23
  * ```typescript
24
- * const secret = await sdk.createSecret({
24
+ * const secret = await client.createSecret({
25
25
  * variant: 'password',
26
26
  * name: 'db_password',
27
27
  * description: 'Production DB password',
@@ -36,16 +36,16 @@ import { validateJSON } from '../api/utils/validation';
36
36
  export class SecretDTO {
37
37
  /** @internal */
38
38
  _data;
39
- _sdk;
39
+ _client;
40
40
  _deleted = false;
41
41
  /**
42
42
  * Create a Secret instance.
43
43
  * @param data - Secret data from API
44
- * @param sdk - Client instance
44
+ * @param client - Client instance
45
45
  */
46
- constructor(data, sdk) {
46
+ constructor(data, client) {
47
47
  this._data = data;
48
- this._sdk = sdk;
48
+ this._client = client;
49
49
  }
50
50
  // ========================================================================
51
51
  // Helper Methods
@@ -105,7 +105,7 @@ export class SecretDTO {
105
105
  */
106
106
  async update(updates) {
107
107
  this._checkDeleted();
108
- const updated = await this._sdk.updateSecret(this.uid, updates);
108
+ const updated = await this._client.updateSecret(this.uid, updates);
109
109
  return updated;
110
110
  }
111
111
  /**
@@ -113,7 +113,7 @@ export class SecretDTO {
113
113
  */
114
114
  async delete() {
115
115
  this._checkDeleted();
116
- await this._sdk.deleteSecret(this.uid);
116
+ await this._client.deleteSecret(this.uid);
117
117
  this._deleted = true;
118
118
  }
119
119
  // ========================================================================
@@ -34,6 +34,9 @@ export const asSpace = (raw_space) => {
34
34
  organization: {
35
35
  handle: raw_space.handle_s,
36
36
  },
37
+ // Preserve raw Solr fields so consumers can access dynamic fields
38
+ // (e.g. attached_agent_pod_name_s for project-agent assignment)
39
+ ...raw_space,
37
40
  };
38
41
  return space;
39
42
  };
@@ -48,16 +48,16 @@ export interface SpaceJSON {
48
48
  */
49
49
  export declare class SpaceDTO {
50
50
  protected _data: SpaceData;
51
- private _sdk;
51
+ private _client;
52
52
  private _items;
53
53
  private _deleted;
54
54
  /**
55
55
  * Create a Space instance.
56
56
  *
57
57
  * @param data - Space data from API
58
- * @param sdk - Client instance
58
+ * @param client - Client instance
59
59
  */
60
- constructor(data: SpaceData, sdk: DatalayerClient);
60
+ constructor(data: SpaceData, client: DatalayerClient);
61
61
  /**
62
62
  * Check if this space has been deleted and throw error if so.
63
63
  * @throws Error if deleted
@@ -29,18 +29,18 @@ import { validateJSON } from '../api/utils/validation';
29
29
  */
30
30
  export class SpaceDTO {
31
31
  _data;
32
- _sdk;
32
+ _client;
33
33
  _items = null;
34
34
  _deleted = false;
35
35
  /**
36
36
  * Create a Space instance.
37
37
  *
38
38
  * @param data - Space data from API
39
- * @param sdk - Client instance
39
+ * @param client - Client instance
40
40
  */
41
- constructor(data, sdk) {
41
+ constructor(data, client) {
42
42
  this._data = data;
43
- this._sdk = sdk;
43
+ this._client = client;
44
44
  }
45
45
  // ========================================================================
46
46
  // Helper Methods
@@ -58,8 +58,8 @@ export class SpaceDTO {
58
58
  * Refresh space data from the API by fetching user's spaces.
59
59
  */
60
60
  async refresh() {
61
- const token = this._sdk.getToken();
62
- const spacerRunUrl = this._sdk.getSpacerRunUrl();
61
+ const token = this._client.getToken();
62
+ const spacerRunUrl = this._client.getSpacerRunUrl();
63
63
  const response = await users.getMySpaces(token, spacerRunUrl);
64
64
  const freshSpace = response.spaces.find(s => s.uid === this.uid);
65
65
  if (freshSpace) {
@@ -110,8 +110,8 @@ export class SpaceDTO {
110
110
  async _createItem(data) {
111
111
  this._checkDeleted();
112
112
  // Get necessary configuration from Client
113
- const token = this._sdk.getToken();
114
- const spacerRunUrl = this._sdk.getSpacerRunUrl();
113
+ const token = this._client.getToken();
114
+ const spacerRunUrl = this._client.getSpacerRunUrl();
115
115
  if (data.type === ItemTypes.NOTEBOOK) {
116
116
  const requestData = {
117
117
  spaceId: this.uid,
@@ -125,7 +125,7 @@ export class SpaceDTO {
125
125
  throw new Error('Failed to create notebook: No notebook returned');
126
126
  }
127
127
  else {
128
- return new NotebookDTO(response.notebook, this._sdk);
128
+ return new NotebookDTO(response.notebook, this._client);
129
129
  }
130
130
  }
131
131
  else if (data.type === ItemTypes.LEXICAL) {
@@ -141,7 +141,7 @@ export class SpaceDTO {
141
141
  throw new Error('Failed to create lexical document: No document returned');
142
142
  }
143
143
  else {
144
- return new LexicalDTO(response.document, this._sdk);
144
+ return new LexicalDTO(response.document, this._client);
145
145
  }
146
146
  }
147
147
  else {
@@ -155,11 +155,11 @@ export class SpaceDTO {
155
155
  */
156
156
  async getItems() {
157
157
  this._checkDeleted();
158
- const token = this._sdk.getToken();
159
- const spacerRunUrl = this._sdk.getSpacerRunUrl();
158
+ const token = this._client.getToken();
159
+ const spacerRunUrl = this._client.getSpacerRunUrl();
160
160
  const response = await items.getSpaceItems(token, this.uid, spacerRunUrl);
161
161
  // Use shared utility function to convert items to model instances
162
- this._items = convertSpaceItemsToModels(response.items || [], this._sdk);
162
+ this._items = convertSpaceItemsToModels(response.items || [], this._client);
163
163
  return this._items;
164
164
  }
165
165
  /**
@@ -215,7 +215,7 @@ export class SpaceDTO {
215
215
  variant: this.variant,
216
216
  handle: this.handle,
217
217
  items: this._data.items
218
- ? convertSpaceItemsToModels(this._data.items, this._sdk).map(item => item.toJSON())
218
+ ? convertSpaceItemsToModels(this._data.items, this._client).map(item => item.toJSON())
219
219
  : [],
220
220
  };
221
221
  validateJSON(obj, 'Space');
@@ -54,9 +54,9 @@ export declare class UserDTO {
54
54
  * Create a User instance.
55
55
  *
56
56
  * @param data - User data from API
57
- * @param sdk - Client instance (currently unused but kept for compatibility)
57
+ * @param client - Client instance (currently unused but kept for compatibility)
58
58
  */
59
- constructor(data: UserData, sdk?: DatalayerClient);
59
+ constructor(data: UserData, client?: DatalayerClient);
60
60
  get id(): string;
61
61
  get uid(): string;
62
62
  get email(): string;
@@ -13,9 +13,9 @@ export class UserDTO {
13
13
  * Create a User instance.
14
14
  *
15
15
  * @param data - User data from API
16
- * @param sdk - Client instance (currently unused but kept for compatibility)
16
+ * @param client - Client instance (currently unused but kept for compatibility)
17
17
  */
18
- constructor(data, sdk) {
18
+ constructor(data, client) {
19
19
  this._data = data;
20
20
  }
21
21
  // Basic properties
@@ -48,6 +48,6 @@ const TokensTable = () => {
48
48
  };
49
49
  export const Tokens = () => {
50
50
  const navigate = useNavigate();
51
- return (_jsxs(PageLayout, { containerWidth: "full", padding: "normal", style: { overflow: 'visible', minHeight: 'calc(100vh - 45px)' }, children: [_jsx(PageLayout.Header, { children: _jsxs(PageHeader, { children: [_jsx(PageHeader.TitleArea, { variant: "large", children: _jsx(PageHeader.Title, { children: "Tokens" }) }), _jsx(PageHeader.Actions, { children: _jsx(Button, { size: "small", variant: "primary", onClick: e => navigate('/new/token', e), children: "New token" }) })] }) }), _jsx(PageLayout.Content, { children: _jsx(Box, { children: _jsx(TokensTable, {}) }) })] }));
51
+ return (_jsxs(PageLayout, { containerWidth: "full", padding: "normal", style: { overflow: 'visible', minHeight: 'calc(100vh - 45px)' }, children: [_jsx(PageLayout.Header, { children: _jsxs(PageHeader, { children: [_jsx(PageHeader.TitleArea, { variant: "large", children: _jsx(PageHeader.Title, { children: "Tokens" }) }), _jsx(PageHeader.Actions, { children: _jsx(Button, { size: "small", variant: "primary", onClick: e => navigate('/tokens/new', e), children: "New token" }) })] }) }), _jsx(PageLayout.Content, { children: _jsx(Box, { children: _jsx(TokensTable, {}) }) })] }));
52
52
  };
53
53
  export default Tokens;
@@ -43,6 +43,6 @@ const SecretsTable = () => {
43
43
  };
44
44
  export const Secrets = () => {
45
45
  const navigate = useNavigate();
46
- return (_jsxs(PageLayout, { containerWidth: "full", padding: "normal", style: { overflow: 'visible', minHeight: 'calc(100vh - 45px)' }, children: [_jsx(PageLayout.Header, { children: _jsxs(PageHeader, { children: [_jsx(PageHeader.TitleArea, { variant: "large", children: _jsx(PageHeader.Title, { children: "Secrets" }) }), _jsx(PageHeader.Actions, { children: _jsx(Button, { size: "small", variant: "primary", onClick: e => navigate('/new/secret', e), children: "New secret" }) })] }) }), _jsx(PageLayout.Content, { children: _jsx(Box, { children: _jsx(SecretsTable, {}) }) })] }));
46
+ return (_jsxs(PageLayout, { containerWidth: "full", padding: "normal", style: { overflow: 'visible', minHeight: 'calc(100vh - 45px)' }, children: [_jsx(PageLayout.Header, { children: _jsxs(PageHeader, { children: [_jsx(PageHeader.TitleArea, { variant: "large", children: _jsx(PageHeader.Title, { children: "Secrets" }) }), _jsx(PageHeader.Actions, { children: _jsx(Button, { size: "small", variant: "primary", onClick: e => navigate('/secrets/new', e), children: "New secret" }) })] }) }), _jsx(PageLayout.Content, { children: _jsx(Box, { children: _jsx(SecretsTable, {}) }) })] }));
47
47
  };
48
48
  export default Secrets;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/core",
3
- "version": "0.0.27",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -1,193 +0,0 @@
1
- /**
2
- * MCP Server tool configuration
3
- */
4
- export interface MCPServerTool {
5
- name: string;
6
- description: string;
7
- enabled: boolean;
8
- }
9
- /**
10
- * MCP Server configuration
11
- */
12
- export interface MCPServer {
13
- id: string;
14
- name: string;
15
- url?: string;
16
- enabled: boolean;
17
- tools: MCPServerTool[];
18
- command?: string;
19
- args: string[];
20
- isAvailable: boolean;
21
- transport: 'stdio' | 'http';
22
- }
23
- /**
24
- * Agent skill configuration
25
- */
26
- export interface AgentSkill {
27
- id: string;
28
- name: string;
29
- description: string;
30
- version: string;
31
- tags: string[];
32
- enabled: boolean;
33
- }
34
- /**
35
- * Agent specification model
36
- */
37
- export interface AgentSpec {
38
- id: string;
39
- name: string;
40
- description: string;
41
- tags: string[];
42
- enabled: boolean;
43
- mcpServers: MCPServer[];
44
- skills: AgentSkill[];
45
- environmentName: string;
46
- icon?: string;
47
- color?: string;
48
- /** Chat suggestions to show users what this agent can do */
49
- suggestions?: string[];
50
- }
51
- /**
52
- * Agent space status
53
- */
54
- export type AgentSpaceStatus = 'starting' | 'running' | 'paused' | 'terminated' | 'archived';
55
- /**
56
- * Agent space data
57
- */
58
- export interface AgentSpaceData {
59
- id: string;
60
- name: string;
61
- description: string;
62
- status: AgentSpaceStatus;
63
- isPublic: boolean;
64
- tags: string[];
65
- messageCount: number;
66
- createdAt?: string;
67
- updatedAt?: string;
68
- thumbnail?: string;
69
- lastMessage?: string;
70
- author?: string;
71
- avatarUrl?: string;
72
- stars?: number;
73
- podName?: string;
74
- runtimeUrl?: string;
75
- creatorUid?: string;
76
- creatorHandle?: string;
77
- agentSpec?: AgentSpec;
78
- }
79
- /**
80
- * Request to create an agent space
81
- */
82
- export interface CreateAgentSpaceRequest {
83
- /** Name of the agent space */
84
- name: string;
85
- /** Parent space ID */
86
- spaceId: string;
87
- /** Description */
88
- description?: string;
89
- /** Tags for categorization */
90
- tags?: string[];
91
- /** Initial status */
92
- status?: AgentSpaceStatus;
93
- /** Whether publicly visible */
94
- isPublic?: boolean;
95
- /** Agent specification */
96
- agentSpec?: AgentSpec;
97
- /** Thumbnail URL */
98
- thumbnail?: string;
99
- }
100
- /**
101
- * Request to update an agent space
102
- */
103
- export interface UpdateAgentSpaceRequest {
104
- name?: string;
105
- description?: string;
106
- tags?: string[];
107
- status?: AgentSpaceStatus;
108
- isPublic?: boolean;
109
- agentSpec?: AgentSpec;
110
- podName?: string;
111
- runtimeUrl?: string;
112
- messageCount?: number;
113
- lastMessage?: string;
114
- thumbnail?: string;
115
- }
116
- /**
117
- * Response for single agent space operations
118
- */
119
- export interface AgentSpaceResponse {
120
- success: boolean;
121
- message: string;
122
- agentSpace?: AgentSpaceData;
123
- }
124
- /**
125
- * Response for listing agent spaces
126
- */
127
- export interface AgentSpacesResponse {
128
- success: boolean;
129
- message: string;
130
- agentSpaces?: AgentSpaceData[];
131
- }
132
- /**
133
- * Create a new agent space.
134
- * @param token - Authentication token
135
- * @param data - Agent space creation configuration
136
- * @param baseUrl - Base URL for the API (defaults to production)
137
- * @returns Promise resolving to the created agent space response
138
- */
139
- export declare const createAgentSpace: (token: string, data: CreateAgentSpaceRequest, baseUrl?: string) => Promise<AgentSpaceResponse>;
140
- /**
141
- * List agent spaces for the current user.
142
- * @param token - Authentication token
143
- * @param baseUrl - Base URL for the API (defaults to production)
144
- * @returns Promise resolving to the list of agent spaces
145
- */
146
- export declare const listAgentSpaces: (token: string, baseUrl?: string) => Promise<AgentSpacesResponse>;
147
- /**
148
- * List all public agent spaces (Library).
149
- * @param baseUrl - Base URL for the API (defaults to production)
150
- * @returns Promise resolving to the list of public agent spaces
151
- */
152
- export declare const listPublicAgentSpaces: (baseUrl?: string) => Promise<AgentSpacesResponse>;
153
- /**
154
- * Get an agent space by UID.
155
- * @param token - Authentication token
156
- * @param uid - The agent space UID
157
- * @param baseUrl - Base URL for the API (defaults to production)
158
- * @returns Promise resolving to the agent space
159
- */
160
- export declare const getAgentSpace: (token: string, uid: string, baseUrl?: string) => Promise<AgentSpaceResponse>;
161
- /**
162
- * Update an agent space.
163
- * @param token - Authentication token
164
- * @param uid - The agent space UID
165
- * @param data - Update data
166
- * @param baseUrl - Base URL for the API (defaults to production)
167
- * @returns Promise resolving to the updated agent space
168
- */
169
- export declare const updateAgentSpace: (token: string, uid: string, data: UpdateAgentSpaceRequest, baseUrl?: string) => Promise<AgentSpaceResponse>;
170
- /**
171
- * Delete an agent space.
172
- * @param token - Authentication token
173
- * @param uid - The agent space UID
174
- * @param baseUrl - Base URL for the API (defaults to production)
175
- * @returns Promise resolving when deleted
176
- */
177
- export declare const deleteAgentSpace: (token: string, uid: string, baseUrl?: string) => Promise<void>;
178
- /**
179
- * Make an agent space public (add to Library).
180
- * @param token - Authentication token
181
- * @param uid - The agent space UID
182
- * @param baseUrl - Base URL for the API (defaults to production)
183
- * @returns Promise resolving to the updated agent space
184
- */
185
- export declare const makeAgentSpacePublic: (token: string, uid: string, baseUrl?: string) => Promise<AgentSpaceResponse>;
186
- /**
187
- * Make an agent space private (remove from Library).
188
- * @param token - Authentication token
189
- * @param uid - The agent space UID
190
- * @param baseUrl - Base URL for the API (defaults to production)
191
- * @returns Promise resolving to the updated agent space
192
- */
193
- export declare const makeAgentSpacePrivate: (token: string, uid: string, baseUrl?: string) => Promise<AgentSpaceResponse>;
@@ -1,127 +0,0 @@
1
- /*
2
- * Copyright (c) 2023-2025 Datalayer, Inc.
3
- * Distributed under the terms of the Modified BSD License.
4
- */
5
- /**
6
- * Agent Spaces API functions for the Datalayer platform.
7
- *
8
- * Provides functions for creating, listing, updating, and deleting agent spaces.
9
- *
10
- * @module api/spacer/agent-spaces
11
- */
12
- import { requestDatalayerAPI } from '../DatalayerApi';
13
- import { API_BASE_PATHS, DEFAULT_SERVICE_URLS } from '../constants';
14
- // =============================================================================
15
- // API Functions
16
- // =============================================================================
17
- /**
18
- * Create a new agent space.
19
- * @param token - Authentication token
20
- * @param data - Agent space creation configuration
21
- * @param baseUrl - Base URL for the API (defaults to production)
22
- * @returns Promise resolving to the created agent space response
23
- */
24
- export const createAgentSpace = async (token, data, baseUrl = DEFAULT_SERVICE_URLS.SPACER) => {
25
- return requestDatalayerAPI({
26
- url: `${baseUrl}${API_BASE_PATHS.SPACER}/agent-spaces`,
27
- method: 'POST',
28
- token,
29
- body: data,
30
- });
31
- };
32
- /**
33
- * List agent spaces for the current user.
34
- * @param token - Authentication token
35
- * @param baseUrl - Base URL for the API (defaults to production)
36
- * @returns Promise resolving to the list of agent spaces
37
- */
38
- export const listAgentSpaces = async (token, baseUrl = DEFAULT_SERVICE_URLS.SPACER) => {
39
- return requestDatalayerAPI({
40
- url: `${baseUrl}${API_BASE_PATHS.SPACER}/agent-spaces`,
41
- method: 'GET',
42
- token,
43
- });
44
- };
45
- /**
46
- * List all public agent spaces (Library).
47
- * @param baseUrl - Base URL for the API (defaults to production)
48
- * @returns Promise resolving to the list of public agent spaces
49
- */
50
- export const listPublicAgentSpaces = async (baseUrl = DEFAULT_SERVICE_URLS.SPACER) => {
51
- return requestDatalayerAPI({
52
- url: `${baseUrl}${API_BASE_PATHS.SPACER}/agent-spaces/public`,
53
- method: 'GET',
54
- });
55
- };
56
- /**
57
- * Get an agent space by UID.
58
- * @param token - Authentication token
59
- * @param uid - The agent space UID
60
- * @param baseUrl - Base URL for the API (defaults to production)
61
- * @returns Promise resolving to the agent space
62
- */
63
- export const getAgentSpace = async (token, uid, baseUrl = DEFAULT_SERVICE_URLS.SPACER) => {
64
- return requestDatalayerAPI({
65
- url: `${baseUrl}${API_BASE_PATHS.SPACER}/agent-spaces/${uid}`,
66
- method: 'GET',
67
- token,
68
- });
69
- };
70
- /**
71
- * Update an agent space.
72
- * @param token - Authentication token
73
- * @param uid - The agent space UID
74
- * @param data - Update data
75
- * @param baseUrl - Base URL for the API (defaults to production)
76
- * @returns Promise resolving to the updated agent space
77
- */
78
- export const updateAgentSpace = async (token, uid, data, baseUrl = DEFAULT_SERVICE_URLS.SPACER) => {
79
- return requestDatalayerAPI({
80
- url: `${baseUrl}${API_BASE_PATHS.SPACER}/agent-spaces/${uid}`,
81
- method: 'PUT',
82
- token,
83
- body: data,
84
- });
85
- };
86
- /**
87
- * Delete an agent space.
88
- * @param token - Authentication token
89
- * @param uid - The agent space UID
90
- * @param baseUrl - Base URL for the API (defaults to production)
91
- * @returns Promise resolving when deleted
92
- */
93
- export const deleteAgentSpace = async (token, uid, baseUrl = DEFAULT_SERVICE_URLS.SPACER) => {
94
- await requestDatalayerAPI({
95
- url: `${baseUrl}${API_BASE_PATHS.SPACER}/agent-spaces/${uid}`,
96
- method: 'DELETE',
97
- token,
98
- });
99
- };
100
- /**
101
- * Make an agent space public (add to Library).
102
- * @param token - Authentication token
103
- * @param uid - The agent space UID
104
- * @param baseUrl - Base URL for the API (defaults to production)
105
- * @returns Promise resolving to the updated agent space
106
- */
107
- export const makeAgentSpacePublic = async (token, uid, baseUrl = DEFAULT_SERVICE_URLS.SPACER) => {
108
- return requestDatalayerAPI({
109
- url: `${baseUrl}${API_BASE_PATHS.SPACER}/agent-spaces/${uid}/public`,
110
- method: 'POST',
111
- token,
112
- });
113
- };
114
- /**
115
- * Make an agent space private (remove from Library).
116
- * @param token - Authentication token
117
- * @param uid - The agent space UID
118
- * @param baseUrl - Base URL for the API (defaults to production)
119
- * @returns Promise resolving to the updated agent space
120
- */
121
- export const makeAgentSpacePrivate = async (token, uid, baseUrl = DEFAULT_SERVICE_URLS.SPACER) => {
122
- return requestDatalayerAPI({
123
- url: `${baseUrl}${API_BASE_PATHS.SPACER}/agent-spaces/${uid}/private`,
124
- method: 'POST',
125
- token,
126
- });
127
- };
@@ -1,52 +0,0 @@
1
- /**
2
- * Datalayer Accessible Color System
3
- * Based on Datalayer's brand manual - WCAG AA/AAA compliant
4
- */
5
- export declare const datalayerColors: {
6
- black: string;
7
- gray: string;
8
- white: string;
9
- greenBrand: string;
10
- greenAccent: string;
11
- greenText: string;
12
- greenTint: string;
13
- greenBright: string;
14
- greenHover: string;
15
- };
16
- export declare const datalayerTheme: {
17
- animation: {
18
- easeOutCubic: string;
19
- };
20
- borderWidths: (string | number)[];
21
- breakpoints: string[];
22
- fonts: {
23
- normal: any;
24
- mono: string;
25
- };
26
- fontSizes: string[];
27
- fontWeights: {
28
- light: number;
29
- normal: number;
30
- semibold: number;
31
- bold: number;
32
- };
33
- lineHeights: {
34
- condensedUltra: number;
35
- condensed: number;
36
- default: number;
37
- };
38
- radii: string[];
39
- sizes: {
40
- small: string;
41
- medium: string;
42
- large: string;
43
- xlarge: string;
44
- };
45
- space: string[];
46
- } & {
47
- colorSchemes: {
48
- light: {};
49
- dark: {};
50
- };
51
- };
52
- export default datalayerTheme;