@jini-ai/integrations 0.7.0 → 0.7.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.
- package/CHANGELOG.md +13 -0
- package/dist/composio/bounded-data.d.ts +36 -0
- package/dist/composio/bounded-data.js +181 -0
- package/dist/composio/catalog.d.ts +147 -0
- package/dist/composio/catalog.js +126 -0
- package/dist/composio/composio-config.d.ts +42 -0
- package/dist/composio/composio-config.js +145 -0
- package/dist/composio/composio-descriptions.d.ts +16 -0
- package/dist/composio/composio-descriptions.js +766 -0
- package/dist/composio/composio.d.ts +364 -0
- package/dist/composio/composio.js +1902 -0
- package/dist/composio/errors.d.ts +15 -0
- package/dist/composio/errors.js +16 -0
- package/dist/composio/file-lock.d.ts +13 -0
- package/dist/composio/file-lock.js +92 -0
- package/dist/composio/index.d.ts +18 -0
- package/dist/composio/index.js +7 -0
- package/dist/composio/json-schema.d.ts +93 -0
- package/dist/composio/json-schema.js +498 -0
- package/dist/composio/output-protection.d.ts +32 -0
- package/dist/composio/output-protection.js +105 -0
- package/dist/composio/service.d.ts +181 -0
- package/dist/composio/service.js +758 -0
- package/dist/webhooks/signing.js +2 -1
- package/package.json +6 -6
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { JsonValue } from '@jini-ai/protocol';
|
|
2
|
+
import { type JsonObject, type ConnectorDetail, type ConnectorCatalogDefinition, type ConnectorCatalogToolDefinition, type ConnectorStatus } from './catalog.js';
|
|
3
|
+
import { ComposioConnectorProvider, type ComposioAuthConfigPrepareResult, type ComposioConnectionStart } from './composio.js';
|
|
4
|
+
type BoundedJsonObject = JsonObject;
|
|
5
|
+
type BoundedJsonValue = JsonValue;
|
|
6
|
+
export interface ConnectorExecuteRequest {
|
|
7
|
+
connectorId: string;
|
|
8
|
+
toolName: string;
|
|
9
|
+
input: BoundedJsonObject;
|
|
10
|
+
expectedAccountLabel?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ConnectorExecuteResponse {
|
|
13
|
+
ok: true;
|
|
14
|
+
connectorId: string;
|
|
15
|
+
accountLabel?: string;
|
|
16
|
+
toolName: string;
|
|
17
|
+
safety: ConnectorCatalogDefinition['tools'][number]['safety'];
|
|
18
|
+
output: BoundedJsonValue;
|
|
19
|
+
outputSummary?: string;
|
|
20
|
+
metadata?: BoundedJsonObject;
|
|
21
|
+
}
|
|
22
|
+
export interface ConnectorConnectResult {
|
|
23
|
+
connector: ConnectorDetail;
|
|
24
|
+
auth?: Pick<ComposioConnectionStart, 'kind' | 'redirectUrl' | 'providerConnectionId' | 'expiresAt'>;
|
|
25
|
+
}
|
|
26
|
+
export interface ConnectorAuthConfigPrepareResponse {
|
|
27
|
+
results: Record<string, ComposioAuthConfigPrepareResult>;
|
|
28
|
+
}
|
|
29
|
+
export { ConnectorServiceError, type ConnectorServiceErrorCode } from './errors.js';
|
|
30
|
+
export { CONNECTOR_MAX_OUTPUT_BYTES, protectConnectorOutput, type ConnectorOutputProtectionResult, } from './output-protection.js';
|
|
31
|
+
export interface ConnectorConnectionStatus {
|
|
32
|
+
status: ConnectorStatus;
|
|
33
|
+
accountLabel?: string;
|
|
34
|
+
lastError?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ConnectorConnectionRecord extends ConnectorConnectionStatus {
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ConnectorDiscoveryResult {
|
|
40
|
+
connectors: ConnectorDetail[];
|
|
41
|
+
meta?: {
|
|
42
|
+
provider: 'composio';
|
|
43
|
+
refreshRequested?: boolean;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export type ConnectorCredentialMaterial = JsonObject;
|
|
47
|
+
export interface ConnectorCredentialRecord {
|
|
48
|
+
schemaVersion: 1;
|
|
49
|
+
connectorId: string;
|
|
50
|
+
accountLabel: string;
|
|
51
|
+
credentials: ConnectorCredentialMaterial;
|
|
52
|
+
updatedAt: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ConnectorCredentialStore {
|
|
55
|
+
get(connectorId: string): ConnectorCredentialRecord | undefined;
|
|
56
|
+
set(record: ConnectorCredentialRecord): void;
|
|
57
|
+
delete(connectorId: string): void;
|
|
58
|
+
deleteByProvider(provider: string): void;
|
|
59
|
+
}
|
|
60
|
+
export interface ConnectorStatusServiceOptions {
|
|
61
|
+
initialStatuses?: Record<string, ConnectorConnectionStatus>;
|
|
62
|
+
credentialStore?: ConnectorCredentialStore;
|
|
63
|
+
now?: () => number;
|
|
64
|
+
}
|
|
65
|
+
export declare class InMemoryConnectorCredentialStore implements ConnectorCredentialStore {
|
|
66
|
+
private readonly records;
|
|
67
|
+
get(connectorId: string): ConnectorCredentialRecord | undefined;
|
|
68
|
+
set(record: ConnectorCredentialRecord): void;
|
|
69
|
+
delete(connectorId: string): void;
|
|
70
|
+
deleteByProvider(provider: string): void;
|
|
71
|
+
}
|
|
72
|
+
export declare class FileConnectorCredentialStore implements ConnectorCredentialStore {
|
|
73
|
+
private readonly filePath;
|
|
74
|
+
constructor({ filePath }: {
|
|
75
|
+
filePath: string;
|
|
76
|
+
});
|
|
77
|
+
get(connectorId: string): ConnectorCredentialRecord | undefined;
|
|
78
|
+
set(record: ConnectorCredentialRecord): void;
|
|
79
|
+
delete(connectorId: string): void;
|
|
80
|
+
deleteByProvider(provider: string): void;
|
|
81
|
+
private readRecords;
|
|
82
|
+
private writeRecords;
|
|
83
|
+
}
|
|
84
|
+
/** In-memory connection state backed optionally by durable credentials. */
|
|
85
|
+
export declare class ConnectorStatusService {
|
|
86
|
+
private readonly statuses;
|
|
87
|
+
private readonly now;
|
|
88
|
+
private credentialStore;
|
|
89
|
+
constructor(options?: ConnectorStatusServiceOptions);
|
|
90
|
+
setCredentialStore(credentialStore: ConnectorCredentialStore): void;
|
|
91
|
+
deleteCredentialsByProvider(provider: string): void;
|
|
92
|
+
getStatus(definition: ConnectorCatalogDefinition): ConnectorConnectionStatus;
|
|
93
|
+
listStatuses(): Record<string, ConnectorConnectionStatus>;
|
|
94
|
+
connect(definition: ConnectorCatalogDefinition, accountLabel?: string, credentials?: ConnectorCredentialMaterial): ConnectorConnectionStatus;
|
|
95
|
+
getCredential(connectorId: string): ConnectorCredentialRecord | undefined;
|
|
96
|
+
disconnect(definition: ConnectorCatalogDefinition): ConnectorConnectionStatus;
|
|
97
|
+
setError(definition: ConnectorCatalogDefinition, lastError: string, accountLabel?: string): ConnectorConnectionStatus;
|
|
98
|
+
markAuthenticationExpired(definition: ConnectorCatalogDefinition, lastError: string, accountLabel?: string): ConnectorConnectionStatus;
|
|
99
|
+
clear(connectorId: string): void;
|
|
100
|
+
}
|
|
101
|
+
export interface ConnectorExecutionContext {
|
|
102
|
+
/** Stable host scope used to isolate rate limits. */
|
|
103
|
+
scopeId: string;
|
|
104
|
+
/** Optional run/session key. A bounded purpose bucket is used when absent. */
|
|
105
|
+
sessionId?: string;
|
|
106
|
+
purpose?: 'agent_preview' | 'background_refresh';
|
|
107
|
+
signal?: AbortSignal;
|
|
108
|
+
}
|
|
109
|
+
export declare const CONNECTOR_RUN_RATE_LIMIT_CALLS = 10;
|
|
110
|
+
export declare const CONNECTOR_RUN_RATE_LIMIT_WINDOW_MS = 60000;
|
|
111
|
+
export declare const CONNECTOR_RUN_LIMIT_TTL_MS: number;
|
|
112
|
+
export declare const CONNECTOR_RUN_TOTAL_CALL_LIMIT = 60;
|
|
113
|
+
export declare const COMPOSIO_AUTH_CONFIG_PREPARE_LIMIT = 100;
|
|
114
|
+
/** Explicit dependencies for {@link ComposioConnectorService}. */
|
|
115
|
+
export interface ComposioConnectorServiceOptions {
|
|
116
|
+
provider: ComposioConnectorProvider;
|
|
117
|
+
statusService?: ConnectorStatusService;
|
|
118
|
+
now?: () => number;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Application service that coordinates the Composio provider, connection
|
|
122
|
+
* status, durable credentials, safety policy, and execution limits.
|
|
123
|
+
*/
|
|
124
|
+
export declare class ComposioConnectorService {
|
|
125
|
+
private readonly runLimits;
|
|
126
|
+
private readonly provider;
|
|
127
|
+
private readonly statusService;
|
|
128
|
+
private readonly now;
|
|
129
|
+
constructor(options: ComposioConnectorServiceOptions);
|
|
130
|
+
setCredentialStore(credentialStore: ConnectorCredentialStore): void;
|
|
131
|
+
deleteCredentialsByProvider(provider: string): void;
|
|
132
|
+
listDefinitions(signal?: AbortSignal): Promise<ConnectorCatalogDefinition[]>;
|
|
133
|
+
listHydratedDefinitions(signal?: AbortSignal): Promise<ConnectorCatalogDefinition[]>;
|
|
134
|
+
listFastDefinitions(): ConnectorCatalogDefinition[];
|
|
135
|
+
getFastDefinition(connectorId: string): ConnectorCatalogDefinition | undefined;
|
|
136
|
+
getDefinition(connectorId: string, signal?: AbortSignal): Promise<ConnectorCatalogDefinition | undefined>;
|
|
137
|
+
getHydratedDefinition(connectorId: string, signal?: AbortSignal): Promise<ConnectorCatalogDefinition | undefined>;
|
|
138
|
+
getPreviewDefinition(connectorId: string, options: {
|
|
139
|
+
toolsLimit: number;
|
|
140
|
+
toolsCursor?: string;
|
|
141
|
+
signal?: AbortSignal;
|
|
142
|
+
}): Promise<ConnectorCatalogDefinition | undefined>;
|
|
143
|
+
getStatus(definition: ConnectorCatalogDefinition): ConnectorConnectionStatus;
|
|
144
|
+
getCredential(connectorId: string): ConnectorCredentialRecord | undefined;
|
|
145
|
+
listConnectors(signal?: AbortSignal): Promise<ConnectorDetail[]>;
|
|
146
|
+
listConnectorStatuses(): Record<string, ConnectorConnectionStatus>;
|
|
147
|
+
listConnectorDiscovery(options?: {
|
|
148
|
+
refresh?: boolean;
|
|
149
|
+
hydrateTools?: boolean;
|
|
150
|
+
signal?: AbortSignal;
|
|
151
|
+
}): Promise<ConnectorDiscoveryResult>;
|
|
152
|
+
getConnector(connectorId: string, signal?: AbortSignal): Promise<ConnectorDetail>;
|
|
153
|
+
getHydratedConnector(connectorId: string, signal?: AbortSignal): Promise<ConnectorDetail>;
|
|
154
|
+
getPreviewConnector(connectorId: string, options: {
|
|
155
|
+
toolsLimit: number;
|
|
156
|
+
toolsCursor?: string;
|
|
157
|
+
signal?: AbortSignal;
|
|
158
|
+
}): Promise<ConnectorDetail>;
|
|
159
|
+
prepareAuthConfigs(connectorIds: readonly string[], signal?: AbortSignal): Promise<ConnectorAuthConfigPrepareResponse>;
|
|
160
|
+
connect(connectorId: string, options?: {
|
|
161
|
+
accountLabel?: string;
|
|
162
|
+
credentials?: ConnectorCredentialMaterial;
|
|
163
|
+
callbackUrl?: string;
|
|
164
|
+
signal?: AbortSignal;
|
|
165
|
+
}): Promise<ConnectorConnectResult>;
|
|
166
|
+
disconnect(connectorId: string, signal?: AbortSignal): Promise<ConnectorDetail>;
|
|
167
|
+
cancelPendingAuthorization(connectorId: string): Promise<ConnectorDetail>;
|
|
168
|
+
completeComposioConnection(input: {
|
|
169
|
+
connectorId: string;
|
|
170
|
+
state: string;
|
|
171
|
+
providerConnectionId?: string;
|
|
172
|
+
status?: string;
|
|
173
|
+
signal?: AbortSignal;
|
|
174
|
+
}): Promise<ConnectorDetail>;
|
|
175
|
+
execute(request: ConnectorExecuteRequest, context: ConnectorExecutionContext): Promise<ConnectorExecuteResponse>;
|
|
176
|
+
protected executeConnectorProviderTool(request: ConnectorExecuteRequest, context: ConnectorExecutionContext, resolvedDefinition?: ConnectorCatalogDefinition, resolvedTool?: ConnectorCatalogToolDefinition): Promise<BoundedJsonObject>;
|
|
177
|
+
private enforceRunLimits;
|
|
178
|
+
private pruneRunLimits;
|
|
179
|
+
private toDetail;
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=service.d.ts.map
|