@palettelab/sdk 0.1.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.
- package/dist/components/index.d.mts +15 -0
- package/dist/components/index.d.ts +15 -0
- package/dist/components/index.js +42 -0
- package/dist/components/index.mjs +15 -0
- package/dist/data-room-BP0PjYoe.d.mts +125 -0
- package/dist/data-room-BP0PjYoe.d.ts +125 -0
- package/dist/hooks/index.d.mts +71 -0
- package/dist/hooks/index.d.ts +71 -0
- package/dist/hooks/index.js +246 -0
- package/dist/hooks/index.mjs +215 -0
- package/dist/index.d.mts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +316 -0
- package/dist/index.mjs +280 -0
- package/dist/plugin-CQH23f5N.d.mts +139 -0
- package/dist/plugin-CQH23f5N.d.ts +139 -0
- package/dist/types/index.d.mts +20 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.mjs +0 -0
- package/package.json +58 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/** Organisation summary for org switching */
|
|
2
|
+
interface OrgSummary {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
theme_id: string;
|
|
7
|
+
logo_url: string | null;
|
|
8
|
+
}
|
|
9
|
+
/** Authenticated user object */
|
|
10
|
+
interface User {
|
|
11
|
+
id: string;
|
|
12
|
+
email: string;
|
|
13
|
+
name: string;
|
|
14
|
+
is_active: boolean;
|
|
15
|
+
created_at: string;
|
|
16
|
+
onboarding_completed: boolean;
|
|
17
|
+
company_name: string | null;
|
|
18
|
+
company_type: string | null;
|
|
19
|
+
org_theme: string | null;
|
|
20
|
+
org_logo: string | null;
|
|
21
|
+
org_enabled_menu_items: string[] | null;
|
|
22
|
+
org_menu_labels: Record<string, string> | null;
|
|
23
|
+
org_enabled_apps: string[] | null;
|
|
24
|
+
org_app_store_enabled: boolean;
|
|
25
|
+
org_enabled_agent_ids: number[] | null;
|
|
26
|
+
organization_id: number | null;
|
|
27
|
+
org_role: string | null;
|
|
28
|
+
}
|
|
29
|
+
/** Auth context methods available to plugins */
|
|
30
|
+
interface AuthContextValue {
|
|
31
|
+
user: User | null;
|
|
32
|
+
loading: boolean;
|
|
33
|
+
logout: () => Promise<void>;
|
|
34
|
+
refreshUser: () => Promise<void>;
|
|
35
|
+
orgs: OrgSummary[];
|
|
36
|
+
switchOrg: (orgId: number) => Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Agent definition */
|
|
40
|
+
interface Agent {
|
|
41
|
+
id: number;
|
|
42
|
+
name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
long_description: string;
|
|
45
|
+
icon_name: string;
|
|
46
|
+
tools: string[];
|
|
47
|
+
status: string;
|
|
48
|
+
field: string;
|
|
49
|
+
category: string;
|
|
50
|
+
efficiency: string;
|
|
51
|
+
tasks_completed: number;
|
|
52
|
+
color: string;
|
|
53
|
+
rating: number;
|
|
54
|
+
avatar: string | null;
|
|
55
|
+
ui_type: string;
|
|
56
|
+
}
|
|
57
|
+
/** Agent configuration per organization */
|
|
58
|
+
interface AgentConfig {
|
|
59
|
+
id: number;
|
|
60
|
+
agent_id: number;
|
|
61
|
+
instructions: string | null;
|
|
62
|
+
dos: string | null;
|
|
63
|
+
donts: string | null;
|
|
64
|
+
nickname: string | null;
|
|
65
|
+
avatar_url: string | null;
|
|
66
|
+
daily_routines: string | null;
|
|
67
|
+
notes: string | null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** App store category */
|
|
71
|
+
type AppCategory = "All" | "Productivity" | "Design" | "Marketing" | "Analytics";
|
|
72
|
+
/** Plugin manifest — corresponds to palette-plugin.json */
|
|
73
|
+
interface PluginManifest {
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
version: string;
|
|
77
|
+
developer: string;
|
|
78
|
+
category: Exclude<AppCategory, "All">;
|
|
79
|
+
tagline: string;
|
|
80
|
+
description: string;
|
|
81
|
+
icon: string;
|
|
82
|
+
gradient: {
|
|
83
|
+
bg: string;
|
|
84
|
+
text: string;
|
|
85
|
+
};
|
|
86
|
+
frontend?: {
|
|
87
|
+
entry: string;
|
|
88
|
+
};
|
|
89
|
+
backend?: {
|
|
90
|
+
entry: string;
|
|
91
|
+
routes_prefix?: string;
|
|
92
|
+
};
|
|
93
|
+
agents?: PluginAgentDefinition[];
|
|
94
|
+
tools?: PluginToolDefinition[];
|
|
95
|
+
permissions?: string[];
|
|
96
|
+
rating?: number;
|
|
97
|
+
reviews?: number;
|
|
98
|
+
featured?: boolean;
|
|
99
|
+
}
|
|
100
|
+
interface PluginAgentDefinition {
|
|
101
|
+
name: string;
|
|
102
|
+
field: string;
|
|
103
|
+
description: string;
|
|
104
|
+
long_description?: string;
|
|
105
|
+
category?: string;
|
|
106
|
+
tools?: string[];
|
|
107
|
+
icon_name?: string;
|
|
108
|
+
color?: string;
|
|
109
|
+
}
|
|
110
|
+
interface PluginToolDefinition {
|
|
111
|
+
name: string;
|
|
112
|
+
description: string;
|
|
113
|
+
entry: string;
|
|
114
|
+
}
|
|
115
|
+
/** Context provided to every plugin component at runtime */
|
|
116
|
+
interface PlatformContext {
|
|
117
|
+
/** Current authenticated user */
|
|
118
|
+
user: User;
|
|
119
|
+
/** Current organization ID */
|
|
120
|
+
organizationId: number;
|
|
121
|
+
/** User's org role */
|
|
122
|
+
orgRole: string | null;
|
|
123
|
+
/** Available orgs */
|
|
124
|
+
orgs: OrgSummary[];
|
|
125
|
+
/** Available agents */
|
|
126
|
+
agents: Agent[];
|
|
127
|
+
/** API fetch helper with auth handling */
|
|
128
|
+
apiFetch: (path: string, init?: RequestInit) => Promise<Response>;
|
|
129
|
+
/** Navigate to a platform route */
|
|
130
|
+
navigate: (path: string) => void;
|
|
131
|
+
/** Show a toast notification */
|
|
132
|
+
showToast: (message: string, type?: "success" | "error" | "info") => void;
|
|
133
|
+
}
|
|
134
|
+
/** Props passed to a plugin's root component */
|
|
135
|
+
interface PluginComponentProps {
|
|
136
|
+
platform: PlatformContext;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export type { Agent as A, OrgSummary as O, PlatformContext as P, User as U, AgentConfig as a, AppCategory as b, AuthContextValue as c, PluginAgentDefinition as d, PluginComponentProps as e, PluginManifest as f, PluginToolDefinition as g };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/** Organisation summary for org switching */
|
|
2
|
+
interface OrgSummary {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
theme_id: string;
|
|
7
|
+
logo_url: string | null;
|
|
8
|
+
}
|
|
9
|
+
/** Authenticated user object */
|
|
10
|
+
interface User {
|
|
11
|
+
id: string;
|
|
12
|
+
email: string;
|
|
13
|
+
name: string;
|
|
14
|
+
is_active: boolean;
|
|
15
|
+
created_at: string;
|
|
16
|
+
onboarding_completed: boolean;
|
|
17
|
+
company_name: string | null;
|
|
18
|
+
company_type: string | null;
|
|
19
|
+
org_theme: string | null;
|
|
20
|
+
org_logo: string | null;
|
|
21
|
+
org_enabled_menu_items: string[] | null;
|
|
22
|
+
org_menu_labels: Record<string, string> | null;
|
|
23
|
+
org_enabled_apps: string[] | null;
|
|
24
|
+
org_app_store_enabled: boolean;
|
|
25
|
+
org_enabled_agent_ids: number[] | null;
|
|
26
|
+
organization_id: number | null;
|
|
27
|
+
org_role: string | null;
|
|
28
|
+
}
|
|
29
|
+
/** Auth context methods available to plugins */
|
|
30
|
+
interface AuthContextValue {
|
|
31
|
+
user: User | null;
|
|
32
|
+
loading: boolean;
|
|
33
|
+
logout: () => Promise<void>;
|
|
34
|
+
refreshUser: () => Promise<void>;
|
|
35
|
+
orgs: OrgSummary[];
|
|
36
|
+
switchOrg: (orgId: number) => Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Agent definition */
|
|
40
|
+
interface Agent {
|
|
41
|
+
id: number;
|
|
42
|
+
name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
long_description: string;
|
|
45
|
+
icon_name: string;
|
|
46
|
+
tools: string[];
|
|
47
|
+
status: string;
|
|
48
|
+
field: string;
|
|
49
|
+
category: string;
|
|
50
|
+
efficiency: string;
|
|
51
|
+
tasks_completed: number;
|
|
52
|
+
color: string;
|
|
53
|
+
rating: number;
|
|
54
|
+
avatar: string | null;
|
|
55
|
+
ui_type: string;
|
|
56
|
+
}
|
|
57
|
+
/** Agent configuration per organization */
|
|
58
|
+
interface AgentConfig {
|
|
59
|
+
id: number;
|
|
60
|
+
agent_id: number;
|
|
61
|
+
instructions: string | null;
|
|
62
|
+
dos: string | null;
|
|
63
|
+
donts: string | null;
|
|
64
|
+
nickname: string | null;
|
|
65
|
+
avatar_url: string | null;
|
|
66
|
+
daily_routines: string | null;
|
|
67
|
+
notes: string | null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** App store category */
|
|
71
|
+
type AppCategory = "All" | "Productivity" | "Design" | "Marketing" | "Analytics";
|
|
72
|
+
/** Plugin manifest — corresponds to palette-plugin.json */
|
|
73
|
+
interface PluginManifest {
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
version: string;
|
|
77
|
+
developer: string;
|
|
78
|
+
category: Exclude<AppCategory, "All">;
|
|
79
|
+
tagline: string;
|
|
80
|
+
description: string;
|
|
81
|
+
icon: string;
|
|
82
|
+
gradient: {
|
|
83
|
+
bg: string;
|
|
84
|
+
text: string;
|
|
85
|
+
};
|
|
86
|
+
frontend?: {
|
|
87
|
+
entry: string;
|
|
88
|
+
};
|
|
89
|
+
backend?: {
|
|
90
|
+
entry: string;
|
|
91
|
+
routes_prefix?: string;
|
|
92
|
+
};
|
|
93
|
+
agents?: PluginAgentDefinition[];
|
|
94
|
+
tools?: PluginToolDefinition[];
|
|
95
|
+
permissions?: string[];
|
|
96
|
+
rating?: number;
|
|
97
|
+
reviews?: number;
|
|
98
|
+
featured?: boolean;
|
|
99
|
+
}
|
|
100
|
+
interface PluginAgentDefinition {
|
|
101
|
+
name: string;
|
|
102
|
+
field: string;
|
|
103
|
+
description: string;
|
|
104
|
+
long_description?: string;
|
|
105
|
+
category?: string;
|
|
106
|
+
tools?: string[];
|
|
107
|
+
icon_name?: string;
|
|
108
|
+
color?: string;
|
|
109
|
+
}
|
|
110
|
+
interface PluginToolDefinition {
|
|
111
|
+
name: string;
|
|
112
|
+
description: string;
|
|
113
|
+
entry: string;
|
|
114
|
+
}
|
|
115
|
+
/** Context provided to every plugin component at runtime */
|
|
116
|
+
interface PlatformContext {
|
|
117
|
+
/** Current authenticated user */
|
|
118
|
+
user: User;
|
|
119
|
+
/** Current organization ID */
|
|
120
|
+
organizationId: number;
|
|
121
|
+
/** User's org role */
|
|
122
|
+
orgRole: string | null;
|
|
123
|
+
/** Available orgs */
|
|
124
|
+
orgs: OrgSummary[];
|
|
125
|
+
/** Available agents */
|
|
126
|
+
agents: Agent[];
|
|
127
|
+
/** API fetch helper with auth handling */
|
|
128
|
+
apiFetch: (path: string, init?: RequestInit) => Promise<Response>;
|
|
129
|
+
/** Navigate to a platform route */
|
|
130
|
+
navigate: (path: string) => void;
|
|
131
|
+
/** Show a toast notification */
|
|
132
|
+
showToast: (message: string, type?: "success" | "error" | "info") => void;
|
|
133
|
+
}
|
|
134
|
+
/** Props passed to a plugin's root component */
|
|
135
|
+
interface PluginComponentProps {
|
|
136
|
+
platform: PlatformContext;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export type { Agent as A, OrgSummary as O, PlatformContext as P, User as U, AgentConfig as a, AppCategory as b, AuthContextValue as c, PluginAgentDefinition as d, PluginComponentProps as e, PluginManifest as f, PluginToolDefinition as g };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { A as Agent, a as AgentConfig, b as AppCategory, c as AuthContextValue, O as OrgSummary, P as PlatformContext, d as PluginAgentDefinition, e as PluginComponentProps, f as PluginManifest, g as PluginToolDefinition, U as User } from '../plugin-CQH23f5N.mjs';
|
|
2
|
+
export { C as ChatAttachment, a as ChatMessage, b as ChatThread, D as DataRoom, c as DataRoomFile, d as DataRoomFolder, e as DataRoomPermission, T as Task, f as TaskAgentSnippet, g as TaskCreatePayload, h as TaskPriority, i as TaskStats, j as TaskStatus, k as TaskType, l as TaskUpdatePayload } from '../data-room-BP0PjYoe.mjs';
|
|
3
|
+
|
|
4
|
+
interface AgentResource {
|
|
5
|
+
id: number;
|
|
6
|
+
agent_id: number;
|
|
7
|
+
group_name: string;
|
|
8
|
+
filename: string;
|
|
9
|
+
file_url: string;
|
|
10
|
+
file_size: number;
|
|
11
|
+
mime_type: string;
|
|
12
|
+
is_linked: boolean;
|
|
13
|
+
is_enabled: boolean;
|
|
14
|
+
data_room_file_id: number | null;
|
|
15
|
+
description: string | null;
|
|
16
|
+
created_at: string;
|
|
17
|
+
}
|
|
18
|
+
type ResourcesByGroup = Record<string, AgentResource[]>;
|
|
19
|
+
|
|
20
|
+
export type { AgentResource, ResourcesByGroup };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { A as Agent, a as AgentConfig, b as AppCategory, c as AuthContextValue, O as OrgSummary, P as PlatformContext, d as PluginAgentDefinition, e as PluginComponentProps, f as PluginManifest, g as PluginToolDefinition, U as User } from '../plugin-CQH23f5N.js';
|
|
2
|
+
export { C as ChatAttachment, a as ChatMessage, b as ChatThread, D as DataRoom, c as DataRoomFile, d as DataRoomFolder, e as DataRoomPermission, T as Task, f as TaskAgentSnippet, g as TaskCreatePayload, h as TaskPriority, i as TaskStats, j as TaskStatus, k as TaskType, l as TaskUpdatePayload } from '../data-room-BP0PjYoe.js';
|
|
3
|
+
|
|
4
|
+
interface AgentResource {
|
|
5
|
+
id: number;
|
|
6
|
+
agent_id: number;
|
|
7
|
+
group_name: string;
|
|
8
|
+
filename: string;
|
|
9
|
+
file_url: string;
|
|
10
|
+
file_size: number;
|
|
11
|
+
mime_type: string;
|
|
12
|
+
is_linked: boolean;
|
|
13
|
+
is_enabled: boolean;
|
|
14
|
+
data_room_file_id: number | null;
|
|
15
|
+
description: string | null;
|
|
16
|
+
created_at: string;
|
|
17
|
+
}
|
|
18
|
+
type ResourcesByGroup = Record<string, AgentResource[]>;
|
|
19
|
+
|
|
20
|
+
export type { AgentResource, ResourcesByGroup };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types/index.ts
|
|
17
|
+
var types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(types_exports);
|
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@palettelab/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Palette Platform SDK for building plugins and apps",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./types": {
|
|
14
|
+
"types": "./dist/types/index.d.ts",
|
|
15
|
+
"import": "./dist/types/index.mjs",
|
|
16
|
+
"require": "./dist/types/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./hooks": {
|
|
19
|
+
"types": "./dist/hooks/index.d.ts",
|
|
20
|
+
"import": "./dist/hooks/index.mjs",
|
|
21
|
+
"require": "./dist/hooks/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./components": {
|
|
24
|
+
"types": "./dist/components/index.d.ts",
|
|
25
|
+
"import": "./dist/components/index.mjs",
|
|
26
|
+
"require": "./dist/components/index.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"registry": "https://registry.npmjs.org/",
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/palette-lab/virtual-organisation.git",
|
|
40
|
+
"directory": "sdk/frontend"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsup",
|
|
44
|
+
"dev": "tsup --watch",
|
|
45
|
+
"prepublishOnly": "npm run build"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"react": ">=18",
|
|
49
|
+
"react-dom": ">=18"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^25.6.0",
|
|
53
|
+
"@types/react": "^19.0.0",
|
|
54
|
+
"react": "^19.0.0",
|
|
55
|
+
"tsup": "^8.0.0",
|
|
56
|
+
"typescript": "^5.0.0"
|
|
57
|
+
}
|
|
58
|
+
}
|