@ever-works/composio-plugin 1.0.0 → 1.0.5
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/index.cjs +3528 -0
- package/dist/index.d.cts +186 -0
- package/dist/index.d.ts +186 -0
- package/dist/index.js +3501 -0
- package/package.json +86 -76
- package/LICENSE +0 -661
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { IPlugin, IPipelinePlugin, IFormSchemaProvider, ISkillsProviderPlugin, PluginCategory, JsonSchema, PluginContext, PluginHealthCheck, ValidationResult, ConnectionValidationResult, PluginManifest, FormFieldDefinition, FormFieldGroup, SkillCatalogListOptions, SkillCatalogListResult, PluginSettings, SkillCatalogEntry, SkillCatalogUpdate, PipelineStepDefinition, WorkReference, GenerationRequest, ExistingItems, PipelineExecutionOptions, PipelineProgressCallback, PipelineResult, PipelineState } from '@ever-works/plugin';
|
|
2
|
+
|
|
3
|
+
/** Step IDs for the Composio pipeline. */
|
|
4
|
+
type ComposioStepId = 'validate-composio' | 'prepare-payload' | 'execute-tool' | 'collect-results' | 'capture-screenshots' | 'cleanup';
|
|
5
|
+
/**
|
|
6
|
+
* Identifies a single Composio tool the plugin will invoke.
|
|
7
|
+
*
|
|
8
|
+
* Composio v3 references a tool by its **slug** (e.g. `GMAIL_SEND_EMAIL`,
|
|
9
|
+
* `GITHUB_CREATE_ISSUE`, `SLACK_SEND_MESSAGE`). The slug is unique across
|
|
10
|
+
* toolkits, so `toolkit` is informational only — used for connected-account
|
|
11
|
+
* validation and surfaced in metrics.
|
|
12
|
+
*/
|
|
13
|
+
interface ComposioToolRef {
|
|
14
|
+
toolkit: string;
|
|
15
|
+
toolSlug: string;
|
|
16
|
+
/**
|
|
17
|
+
* The Composio `user_id` whose connected account the tool runs against.
|
|
18
|
+
* The plugin defaults this to the Ever Works user ID; the user can pin a
|
|
19
|
+
* different value (e.g. an email) in plugin settings.
|
|
20
|
+
*/
|
|
21
|
+
userId: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* How the plugin should interpret the tool's response payload.
|
|
25
|
+
* - `structured`: the tool returns `{ items: [...] }` (cleanest for custom tools).
|
|
26
|
+
* - `native`: raw records projected onto work items via a field mapping.
|
|
27
|
+
* - `side-effect`: fire-and-forget (e.g. send email, post message) — no items.
|
|
28
|
+
*/
|
|
29
|
+
type ComposioResultShape = 'structured' | 'native' | 'side-effect';
|
|
30
|
+
/** Field mapping used when the tool returns native records instead of { items: [...] }. */
|
|
31
|
+
interface ComposioFieldMapping {
|
|
32
|
+
nameField: string;
|
|
33
|
+
urlField?: string;
|
|
34
|
+
descriptionField?: string;
|
|
35
|
+
categoryField?: string;
|
|
36
|
+
tagsField?: string;
|
|
37
|
+
imageField?: string;
|
|
38
|
+
brandField?: string;
|
|
39
|
+
contentField?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Data source types for passing data to the Composio tool. */
|
|
42
|
+
type DataSourceType = 'inline' | 'github-repo';
|
|
43
|
+
/** Input payload sent as `arguments` to the Composio tool. */
|
|
44
|
+
interface ComposioToolInput {
|
|
45
|
+
metadata: {
|
|
46
|
+
workId: string;
|
|
47
|
+
workName: string;
|
|
48
|
+
workSlug: string;
|
|
49
|
+
workDescription?: string;
|
|
50
|
+
prompt?: string;
|
|
51
|
+
generationMethod?: string;
|
|
52
|
+
targetItems: number;
|
|
53
|
+
};
|
|
54
|
+
existingSummary?: {
|
|
55
|
+
totalItems: number;
|
|
56
|
+
categories: string[];
|
|
57
|
+
tags: string[];
|
|
58
|
+
sampleItems: Array<{
|
|
59
|
+
name: string;
|
|
60
|
+
url?: string;
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
63
|
+
dataSource?: {
|
|
64
|
+
type: DataSourceType;
|
|
65
|
+
repoUrl?: string;
|
|
66
|
+
accessToken?: string;
|
|
67
|
+
branch?: string;
|
|
68
|
+
path?: string;
|
|
69
|
+
};
|
|
70
|
+
toolParams?: Record<string, unknown>;
|
|
71
|
+
}
|
|
72
|
+
/** Structured work payload returned by a custom Composio tool (mirrors sim-ai / zapier). */
|
|
73
|
+
interface ComposioToolOutput {
|
|
74
|
+
items: ComposioOutputItem[];
|
|
75
|
+
categories?: Array<{
|
|
76
|
+
name: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
}>;
|
|
79
|
+
tags?: Array<{
|
|
80
|
+
name: string;
|
|
81
|
+
}>;
|
|
82
|
+
brands?: Array<{
|
|
83
|
+
name: string;
|
|
84
|
+
url?: string;
|
|
85
|
+
}>;
|
|
86
|
+
}
|
|
87
|
+
interface ComposioOutputItem {
|
|
88
|
+
name: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
url?: string;
|
|
91
|
+
source_url?: string;
|
|
92
|
+
content?: string;
|
|
93
|
+
category?: string;
|
|
94
|
+
tags?: string[];
|
|
95
|
+
brand?: string;
|
|
96
|
+
images?: string[];
|
|
97
|
+
metadata?: Record<string, unknown>;
|
|
98
|
+
}
|
|
99
|
+
/** Resolved settings for the Composio plugin. */
|
|
100
|
+
interface ComposioSettings {
|
|
101
|
+
apiKey?: string;
|
|
102
|
+
baseUrl?: string;
|
|
103
|
+
defaultUserId?: string;
|
|
104
|
+
defaultToolkit?: string;
|
|
105
|
+
defaultToolSlug?: string;
|
|
106
|
+
timeoutMs: number;
|
|
107
|
+
resultShape: ComposioResultShape;
|
|
108
|
+
fieldMapping: ComposioFieldMapping;
|
|
109
|
+
}
|
|
110
|
+
/** Metrics specific to Composio execution. */
|
|
111
|
+
interface ComposioPipelineMetrics {
|
|
112
|
+
toolkit: string;
|
|
113
|
+
toolSlug: string;
|
|
114
|
+
userId: string;
|
|
115
|
+
resultShape: ComposioResultShape;
|
|
116
|
+
composioDuration?: number;
|
|
117
|
+
itemsReturned?: number;
|
|
118
|
+
}
|
|
119
|
+
/** Shape of a Composio connected account (subset of the v3 response). */
|
|
120
|
+
interface ComposioConnectedAccount {
|
|
121
|
+
id: string;
|
|
122
|
+
status: 'INITIATED' | 'ACTIVE' | 'EXPIRED' | 'REVOKED' | 'FAILED' | string;
|
|
123
|
+
toolkit?: {
|
|
124
|
+
slug: string;
|
|
125
|
+
} | undefined;
|
|
126
|
+
user_id?: string;
|
|
127
|
+
}
|
|
128
|
+
/** Shape of a Composio toolkit catalog entry (subset of the v3 response). */
|
|
129
|
+
interface ComposioToolkitEntry {
|
|
130
|
+
slug: string;
|
|
131
|
+
name: string;
|
|
132
|
+
description?: string;
|
|
133
|
+
categories?: string[];
|
|
134
|
+
auth_schemes?: string[];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Composio Integrations Plugin
|
|
139
|
+
*
|
|
140
|
+
* Pipeline plugin that executes a Composio tool during work generation.
|
|
141
|
+
* Composio brokers OAuth across 500+ third-party apps; each user connects
|
|
142
|
+
* their accounts once via Composio's hosted flow, and the platform runs
|
|
143
|
+
* tools against `composio.user_id` (defaulted to the Ever Works user id).
|
|
144
|
+
*/
|
|
145
|
+
declare class ComposioPlugin implements IPlugin, IPipelinePlugin, IFormSchemaProvider, ISkillsProviderPlugin {
|
|
146
|
+
readonly id = "composio";
|
|
147
|
+
readonly name = "Composio Integrations";
|
|
148
|
+
readonly version = "1.0.0";
|
|
149
|
+
readonly category: PluginCategory;
|
|
150
|
+
readonly capabilities: readonly ["pipeline", "form-schema-provider", "skills-provider"];
|
|
151
|
+
readonly configurationMode: "user-required";
|
|
152
|
+
readonly handledConfigFields: readonly ["*"];
|
|
153
|
+
readonly providerName = "Composio Integrations";
|
|
154
|
+
readonly settingsSchema: JsonSchema;
|
|
155
|
+
private context;
|
|
156
|
+
onLoad(context: PluginContext): Promise<void>;
|
|
157
|
+
onUnload(): Promise<void>;
|
|
158
|
+
healthCheck(): Promise<PluginHealthCheck>;
|
|
159
|
+
isAvailable(settings?: Record<string, unknown>): boolean;
|
|
160
|
+
validateSettings(settings: Record<string, unknown>): Promise<ValidationResult>;
|
|
161
|
+
validateConnection(rawSettings: Record<string, unknown>): Promise<ConnectionValidationResult>;
|
|
162
|
+
getManifest(): PluginManifest;
|
|
163
|
+
getFormFields(): FormFieldDefinition[];
|
|
164
|
+
getFormGroups(): FormFieldGroup[];
|
|
165
|
+
validateFormInput(values: Record<string, unknown>): ValidationResult;
|
|
166
|
+
getDefaultValues(): Record<string, unknown>;
|
|
167
|
+
listEntries(options: SkillCatalogListOptions): Promise<SkillCatalogListResult>;
|
|
168
|
+
getEntry(slug: string, settings?: PluginSettings): Promise<SkillCatalogEntry | null>;
|
|
169
|
+
checkForUpdates(installedVersions: Record<string, string>, settings?: PluginSettings): Promise<{
|
|
170
|
+
updated: SkillCatalogUpdate[];
|
|
171
|
+
}>;
|
|
172
|
+
private loadEntries;
|
|
173
|
+
getStepDefinitions(): readonly PipelineStepDefinition[];
|
|
174
|
+
private _lastState;
|
|
175
|
+
private _lastAbortController;
|
|
176
|
+
execute(work: WorkReference, request: GenerationRequest, existing: ExistingItems, options?: PipelineExecutionOptions, onProgress?: PipelineProgressCallback): Promise<PipelineResult>;
|
|
177
|
+
cancel(): Promise<void>;
|
|
178
|
+
getState(): PipelineState<ComposioStepId> | null;
|
|
179
|
+
private resolveComposioSettings;
|
|
180
|
+
private resolveToolRef;
|
|
181
|
+
private collectMissingToolFields;
|
|
182
|
+
private captureScreenshots;
|
|
183
|
+
private flattenSettings;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { type ComposioConnectedAccount, type ComposioFieldMapping, type ComposioOutputItem, type ComposioPipelineMetrics, ComposioPlugin, type ComposioResultShape, type ComposioSettings, type ComposioStepId, type ComposioToolInput, type ComposioToolOutput, type ComposioToolRef, type ComposioToolkitEntry, ComposioPlugin as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { IPlugin, IPipelinePlugin, IFormSchemaProvider, ISkillsProviderPlugin, PluginCategory, JsonSchema, PluginContext, PluginHealthCheck, ValidationResult, ConnectionValidationResult, PluginManifest, FormFieldDefinition, FormFieldGroup, SkillCatalogListOptions, SkillCatalogListResult, PluginSettings, SkillCatalogEntry, SkillCatalogUpdate, PipelineStepDefinition, WorkReference, GenerationRequest, ExistingItems, PipelineExecutionOptions, PipelineProgressCallback, PipelineResult, PipelineState } from '@ever-works/plugin';
|
|
2
|
+
|
|
3
|
+
/** Step IDs for the Composio pipeline. */
|
|
4
|
+
type ComposioStepId = 'validate-composio' | 'prepare-payload' | 'execute-tool' | 'collect-results' | 'capture-screenshots' | 'cleanup';
|
|
5
|
+
/**
|
|
6
|
+
* Identifies a single Composio tool the plugin will invoke.
|
|
7
|
+
*
|
|
8
|
+
* Composio v3 references a tool by its **slug** (e.g. `GMAIL_SEND_EMAIL`,
|
|
9
|
+
* `GITHUB_CREATE_ISSUE`, `SLACK_SEND_MESSAGE`). The slug is unique across
|
|
10
|
+
* toolkits, so `toolkit` is informational only — used for connected-account
|
|
11
|
+
* validation and surfaced in metrics.
|
|
12
|
+
*/
|
|
13
|
+
interface ComposioToolRef {
|
|
14
|
+
toolkit: string;
|
|
15
|
+
toolSlug: string;
|
|
16
|
+
/**
|
|
17
|
+
* The Composio `user_id` whose connected account the tool runs against.
|
|
18
|
+
* The plugin defaults this to the Ever Works user ID; the user can pin a
|
|
19
|
+
* different value (e.g. an email) in plugin settings.
|
|
20
|
+
*/
|
|
21
|
+
userId: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* How the plugin should interpret the tool's response payload.
|
|
25
|
+
* - `structured`: the tool returns `{ items: [...] }` (cleanest for custom tools).
|
|
26
|
+
* - `native`: raw records projected onto work items via a field mapping.
|
|
27
|
+
* - `side-effect`: fire-and-forget (e.g. send email, post message) — no items.
|
|
28
|
+
*/
|
|
29
|
+
type ComposioResultShape = 'structured' | 'native' | 'side-effect';
|
|
30
|
+
/** Field mapping used when the tool returns native records instead of { items: [...] }. */
|
|
31
|
+
interface ComposioFieldMapping {
|
|
32
|
+
nameField: string;
|
|
33
|
+
urlField?: string;
|
|
34
|
+
descriptionField?: string;
|
|
35
|
+
categoryField?: string;
|
|
36
|
+
tagsField?: string;
|
|
37
|
+
imageField?: string;
|
|
38
|
+
brandField?: string;
|
|
39
|
+
contentField?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Data source types for passing data to the Composio tool. */
|
|
42
|
+
type DataSourceType = 'inline' | 'github-repo';
|
|
43
|
+
/** Input payload sent as `arguments` to the Composio tool. */
|
|
44
|
+
interface ComposioToolInput {
|
|
45
|
+
metadata: {
|
|
46
|
+
workId: string;
|
|
47
|
+
workName: string;
|
|
48
|
+
workSlug: string;
|
|
49
|
+
workDescription?: string;
|
|
50
|
+
prompt?: string;
|
|
51
|
+
generationMethod?: string;
|
|
52
|
+
targetItems: number;
|
|
53
|
+
};
|
|
54
|
+
existingSummary?: {
|
|
55
|
+
totalItems: number;
|
|
56
|
+
categories: string[];
|
|
57
|
+
tags: string[];
|
|
58
|
+
sampleItems: Array<{
|
|
59
|
+
name: string;
|
|
60
|
+
url?: string;
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
63
|
+
dataSource?: {
|
|
64
|
+
type: DataSourceType;
|
|
65
|
+
repoUrl?: string;
|
|
66
|
+
accessToken?: string;
|
|
67
|
+
branch?: string;
|
|
68
|
+
path?: string;
|
|
69
|
+
};
|
|
70
|
+
toolParams?: Record<string, unknown>;
|
|
71
|
+
}
|
|
72
|
+
/** Structured work payload returned by a custom Composio tool (mirrors sim-ai / zapier). */
|
|
73
|
+
interface ComposioToolOutput {
|
|
74
|
+
items: ComposioOutputItem[];
|
|
75
|
+
categories?: Array<{
|
|
76
|
+
name: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
}>;
|
|
79
|
+
tags?: Array<{
|
|
80
|
+
name: string;
|
|
81
|
+
}>;
|
|
82
|
+
brands?: Array<{
|
|
83
|
+
name: string;
|
|
84
|
+
url?: string;
|
|
85
|
+
}>;
|
|
86
|
+
}
|
|
87
|
+
interface ComposioOutputItem {
|
|
88
|
+
name: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
url?: string;
|
|
91
|
+
source_url?: string;
|
|
92
|
+
content?: string;
|
|
93
|
+
category?: string;
|
|
94
|
+
tags?: string[];
|
|
95
|
+
brand?: string;
|
|
96
|
+
images?: string[];
|
|
97
|
+
metadata?: Record<string, unknown>;
|
|
98
|
+
}
|
|
99
|
+
/** Resolved settings for the Composio plugin. */
|
|
100
|
+
interface ComposioSettings {
|
|
101
|
+
apiKey?: string;
|
|
102
|
+
baseUrl?: string;
|
|
103
|
+
defaultUserId?: string;
|
|
104
|
+
defaultToolkit?: string;
|
|
105
|
+
defaultToolSlug?: string;
|
|
106
|
+
timeoutMs: number;
|
|
107
|
+
resultShape: ComposioResultShape;
|
|
108
|
+
fieldMapping: ComposioFieldMapping;
|
|
109
|
+
}
|
|
110
|
+
/** Metrics specific to Composio execution. */
|
|
111
|
+
interface ComposioPipelineMetrics {
|
|
112
|
+
toolkit: string;
|
|
113
|
+
toolSlug: string;
|
|
114
|
+
userId: string;
|
|
115
|
+
resultShape: ComposioResultShape;
|
|
116
|
+
composioDuration?: number;
|
|
117
|
+
itemsReturned?: number;
|
|
118
|
+
}
|
|
119
|
+
/** Shape of a Composio connected account (subset of the v3 response). */
|
|
120
|
+
interface ComposioConnectedAccount {
|
|
121
|
+
id: string;
|
|
122
|
+
status: 'INITIATED' | 'ACTIVE' | 'EXPIRED' | 'REVOKED' | 'FAILED' | string;
|
|
123
|
+
toolkit?: {
|
|
124
|
+
slug: string;
|
|
125
|
+
} | undefined;
|
|
126
|
+
user_id?: string;
|
|
127
|
+
}
|
|
128
|
+
/** Shape of a Composio toolkit catalog entry (subset of the v3 response). */
|
|
129
|
+
interface ComposioToolkitEntry {
|
|
130
|
+
slug: string;
|
|
131
|
+
name: string;
|
|
132
|
+
description?: string;
|
|
133
|
+
categories?: string[];
|
|
134
|
+
auth_schemes?: string[];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Composio Integrations Plugin
|
|
139
|
+
*
|
|
140
|
+
* Pipeline plugin that executes a Composio tool during work generation.
|
|
141
|
+
* Composio brokers OAuth across 500+ third-party apps; each user connects
|
|
142
|
+
* their accounts once via Composio's hosted flow, and the platform runs
|
|
143
|
+
* tools against `composio.user_id` (defaulted to the Ever Works user id).
|
|
144
|
+
*/
|
|
145
|
+
declare class ComposioPlugin implements IPlugin, IPipelinePlugin, IFormSchemaProvider, ISkillsProviderPlugin {
|
|
146
|
+
readonly id = "composio";
|
|
147
|
+
readonly name = "Composio Integrations";
|
|
148
|
+
readonly version = "1.0.0";
|
|
149
|
+
readonly category: PluginCategory;
|
|
150
|
+
readonly capabilities: readonly ["pipeline", "form-schema-provider", "skills-provider"];
|
|
151
|
+
readonly configurationMode: "user-required";
|
|
152
|
+
readonly handledConfigFields: readonly ["*"];
|
|
153
|
+
readonly providerName = "Composio Integrations";
|
|
154
|
+
readonly settingsSchema: JsonSchema;
|
|
155
|
+
private context;
|
|
156
|
+
onLoad(context: PluginContext): Promise<void>;
|
|
157
|
+
onUnload(): Promise<void>;
|
|
158
|
+
healthCheck(): Promise<PluginHealthCheck>;
|
|
159
|
+
isAvailable(settings?: Record<string, unknown>): boolean;
|
|
160
|
+
validateSettings(settings: Record<string, unknown>): Promise<ValidationResult>;
|
|
161
|
+
validateConnection(rawSettings: Record<string, unknown>): Promise<ConnectionValidationResult>;
|
|
162
|
+
getManifest(): PluginManifest;
|
|
163
|
+
getFormFields(): FormFieldDefinition[];
|
|
164
|
+
getFormGroups(): FormFieldGroup[];
|
|
165
|
+
validateFormInput(values: Record<string, unknown>): ValidationResult;
|
|
166
|
+
getDefaultValues(): Record<string, unknown>;
|
|
167
|
+
listEntries(options: SkillCatalogListOptions): Promise<SkillCatalogListResult>;
|
|
168
|
+
getEntry(slug: string, settings?: PluginSettings): Promise<SkillCatalogEntry | null>;
|
|
169
|
+
checkForUpdates(installedVersions: Record<string, string>, settings?: PluginSettings): Promise<{
|
|
170
|
+
updated: SkillCatalogUpdate[];
|
|
171
|
+
}>;
|
|
172
|
+
private loadEntries;
|
|
173
|
+
getStepDefinitions(): readonly PipelineStepDefinition[];
|
|
174
|
+
private _lastState;
|
|
175
|
+
private _lastAbortController;
|
|
176
|
+
execute(work: WorkReference, request: GenerationRequest, existing: ExistingItems, options?: PipelineExecutionOptions, onProgress?: PipelineProgressCallback): Promise<PipelineResult>;
|
|
177
|
+
cancel(): Promise<void>;
|
|
178
|
+
getState(): PipelineState<ComposioStepId> | null;
|
|
179
|
+
private resolveComposioSettings;
|
|
180
|
+
private resolveToolRef;
|
|
181
|
+
private collectMissingToolFields;
|
|
182
|
+
private captureScreenshots;
|
|
183
|
+
private flattenSettings;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { type ComposioConnectedAccount, type ComposioFieldMapping, type ComposioOutputItem, type ComposioPipelineMetrics, ComposioPlugin, type ComposioResultShape, type ComposioSettings, type ComposioStepId, type ComposioToolInput, type ComposioToolOutput, type ComposioToolRef, type ComposioToolkitEntry, ComposioPlugin as default };
|