corsair 0.1.76 → 0.1.77

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.
@@ -0,0 +1,55 @@
1
+ import { CorsairDatabase } from './db.js';
2
+ import { H as HubConfig } from './types-DAMJdQTn.js';
3
+ import { C as CorsairPlugin, a as CorsairIntegration, b as CorsairTenantWrapper, c as CorsairSingleTenantClient } from './index-Cyd3nsjL.js';
4
+
5
+ declare const CORSAIR_INTERNAL: unique symbol;
6
+ type CorsairInternalConfig = {
7
+ plugins: readonly CorsairPlugin[];
8
+ database: CorsairDatabase | undefined;
9
+ kek: string;
10
+ multiTenancy: boolean;
11
+ approval?: {
12
+ timeout: string;
13
+ onTimeout: 'deny' | 'approve';
14
+ mode?: 'synchronous' | 'asynchronous' | (() => 'synchronous' | 'asynchronous');
15
+ /** Called when a permission is blocked in async mode. Return the message surfaced to the LLM. */
16
+ formatAsyncMessage?: (opts: {
17
+ token: string;
18
+ id: string;
19
+ plugin: string;
20
+ endpoint: string;
21
+ args: unknown;
22
+ }) => string;
23
+ };
24
+ connect?: {
25
+ baseUrl: string;
26
+ redirectUri: string;
27
+ onAuthMissing?: (opts: {
28
+ plugin: string;
29
+ connectUrl: string;
30
+ state: string;
31
+ }) => string;
32
+ };
33
+ hub?: HubConfig;
34
+ };
35
+ /**
36
+ * Creates a Corsair integration with multi-tenancy enabled.
37
+ * Returns a wrapper with a `withTenant()` method to scope operations to specific tenants,
38
+ * and a `keys` property for integration-level key management.
39
+ * @param config - Configuration with plugins, database, and multiTenancy: true
40
+ * @returns A tenant wrapper with `withTenant(tenantId)` method and integration-level `keys`
41
+ */
42
+ declare function createCorsair<const Plugins extends readonly CorsairPlugin[]>(config: CorsairIntegration<Plugins> & {
43
+ multiTenancy: true;
44
+ }): CorsairTenantWrapper<Plugins>;
45
+ /**
46
+ * Creates a Corsair integration without multi-tenancy.
47
+ * Returns a direct client instance with both plugin APIs and integration-level keys.
48
+ * @param config - Configuration with plugins and optional database
49
+ * @returns A Corsair client instance with plugin APIs and integration-level `keys`
50
+ */
51
+ declare function createCorsair<const Plugins extends readonly CorsairPlugin[]>(config: CorsairIntegration<Plugins> & {
52
+ multiTenancy?: false | undefined;
53
+ }): CorsairSingleTenantClient<Plugins>;
54
+
55
+ export { CORSAIR_INTERNAL as C, type CorsairInternalConfig as a, createCorsair as c };