@collective-intelligence/external-apps-server-sdk 0.0.0-stage → 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/README.md +1075 -2
- package/dist/admin.d.ts +7556 -0
- package/dist/admin.js +6 -0
- package/dist/auth/better-auth.d.ts +71 -0
- package/dist/auth/better-auth.js +1 -0
- package/dist/auth/federated.d.ts +135 -0
- package/dist/auth/federated.js +8 -0
- package/dist/auth.d.ts +162 -0
- package/dist/auth.js +1 -0
- package/dist/express.d.ts +644 -0
- package/dist/express.js +1 -0
- package/dist/gateway/contracts.d.ts +663 -0
- package/dist/gateway/contracts.js +0 -0
- package/dist/gateway.d.ts +762 -0
- package/dist/gateway.js +8 -0
- package/dist/index.d.ts +597 -0
- package/dist/index.js +9 -0
- package/dist/knowledge-sources/payload.d.ts +420 -0
- package/dist/knowledge-sources/payload.js +1 -0
- package/dist/knowledge-sources/strapi.d.ts +389 -0
- package/dist/knowledge-sources/strapi.js +1 -0
- package/dist/persistence/drizzle-effect.d.ts +38 -0
- package/dist/persistence/drizzle-effect.js +1 -0
- package/dist/persistence/drizzle.d.ts +1514 -0
- package/dist/persistence/drizzle.js +18 -0
- package/dist/resources.d.ts +423 -0
- package/dist/resources.js +15 -0
- package/dist/runtime/effect.d.ts +954 -0
- package/dist/runtime/effect.js +15 -0
- package/dist/runtime/express.d.ts +644 -0
- package/dist/runtime/express.js +1 -0
- package/dist/runtime/nestjs.d.ts +802 -0
- package/dist/runtime/nestjs.js +8 -0
- package/dist/runtime/next.d.ts +874 -0
- package/dist/runtime/next.js +8 -0
- package/dist/runtime/web.d.ts +776 -0
- package/dist/runtime/web.js +8 -0
- package/dist/tools/ai-sdk.d.ts +170 -0
- package/dist/tools/ai-sdk.js +8 -0
- package/package.json +242 -4
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
import { FlexibleSchema, Tool } from 'ai';
|
|
4
|
+
|
|
5
|
+
export type JsonPrimitive = boolean | null | number | string;
|
|
6
|
+
export type JsonValue = JsonObject | JsonPrimitive | readonly JsonValue[];
|
|
7
|
+
export interface JsonObject {
|
|
8
|
+
readonly [key: string]: JsonValue;
|
|
9
|
+
}
|
|
10
|
+
declare const Draft202012Dialect: "https://json-schema.org/draft/2020-12/schema";
|
|
11
|
+
/** JSON-compatible Draft 2020-12 vocabulary used for portable manifests. */
|
|
12
|
+
export type JsonSchemaDocument = JsonObject & Readonly<{
|
|
13
|
+
$anchor?: string;
|
|
14
|
+
$comment?: string;
|
|
15
|
+
$defs?: Readonly<Record<string, JsonSchemaDocument>>;
|
|
16
|
+
$dynamicAnchor?: string;
|
|
17
|
+
$dynamicRef?: string;
|
|
18
|
+
$id?: string;
|
|
19
|
+
$ref?: string;
|
|
20
|
+
$schema?: typeof Draft202012Dialect;
|
|
21
|
+
additionalProperties?: boolean | JsonSchemaDocument;
|
|
22
|
+
allOf?: readonly JsonSchemaDocument[];
|
|
23
|
+
anyOf?: readonly JsonSchemaDocument[];
|
|
24
|
+
const?: JsonValue;
|
|
25
|
+
contains?: JsonSchemaDocument;
|
|
26
|
+
default?: JsonValue;
|
|
27
|
+
dependentRequired?: Readonly<Record<string, readonly string[]>>;
|
|
28
|
+
description?: string;
|
|
29
|
+
else?: JsonSchemaDocument;
|
|
30
|
+
enum?: readonly JsonValue[];
|
|
31
|
+
exclusiveMaximum?: number;
|
|
32
|
+
exclusiveMinimum?: number;
|
|
33
|
+
format?: string;
|
|
34
|
+
if?: JsonSchemaDocument;
|
|
35
|
+
items?: JsonSchemaDocument;
|
|
36
|
+
maxItems?: number;
|
|
37
|
+
maxLength?: number;
|
|
38
|
+
maxProperties?: number;
|
|
39
|
+
maximum?: number;
|
|
40
|
+
minItems?: number;
|
|
41
|
+
minLength?: number;
|
|
42
|
+
minProperties?: number;
|
|
43
|
+
minimum?: number;
|
|
44
|
+
multipleOf?: number;
|
|
45
|
+
not?: JsonSchemaDocument;
|
|
46
|
+
oneOf?: readonly JsonSchemaDocument[];
|
|
47
|
+
pattern?: string;
|
|
48
|
+
patternProperties?: Readonly<Record<string, JsonSchemaDocument>>;
|
|
49
|
+
prefixItems?: readonly JsonSchemaDocument[];
|
|
50
|
+
properties?: Readonly<Record<string, JsonSchemaDocument>>;
|
|
51
|
+
required?: readonly string[];
|
|
52
|
+
then?: JsonSchemaDocument;
|
|
53
|
+
title?: string;
|
|
54
|
+
type?: "array" | "boolean" | "integer" | "null" | "number" | "object" | "string" | readonly ("array" | "boolean" | "integer" | "null" | "number" | "object" | "string")[];
|
|
55
|
+
unevaluatedItems?: boolean | JsonSchemaDocument;
|
|
56
|
+
unevaluatedProperties?: boolean | JsonSchemaDocument;
|
|
57
|
+
uniqueItems?: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
export type ProjectionFidelity = "exact" | "structural";
|
|
60
|
+
export type PackageSchemaProjection = Readonly<{
|
|
61
|
+
dialect: typeof Draft202012Dialect;
|
|
62
|
+
document: JsonSchemaDocument;
|
|
63
|
+
fidelity: ProjectionFidelity;
|
|
64
|
+
}>;
|
|
65
|
+
/** Closed public principal vocabulary accepted by a gateway operation. */
|
|
66
|
+
export type PortableOperationPrincipalKind = "detached_user" | "service_principal";
|
|
67
|
+
/** Explicit delegated-subject requirement reviewed with an operation. */
|
|
68
|
+
export type PortableOperationDelegatedSubjectPolicy = "allowed" | "forbidden" | "required";
|
|
69
|
+
/** Fully materialized authorization policy for one exposed operation. */
|
|
70
|
+
export type PortableOperationAuthorization = Readonly<{
|
|
71
|
+
delegatedSubject: PortableOperationDelegatedSubjectPolicy;
|
|
72
|
+
organization: "required";
|
|
73
|
+
principalKinds: readonly PortableOperationPrincipalKind[];
|
|
74
|
+
scopes: readonly string[];
|
|
75
|
+
}>;
|
|
76
|
+
/** Observable side-effect class reviewed before an operation becomes a tool. */
|
|
77
|
+
export type PortableOperationEffect = "external_side_effect" | "read" | "write";
|
|
78
|
+
/** The replay guarantee supplied by the operation implementation. */
|
|
79
|
+
export type PortableOperationIdempotency = "idempotent" | "requires_key" | "safe";
|
|
80
|
+
/** Explicit, bounded retry permission for callers of the operation. */
|
|
81
|
+
export type PortableOperationRetryPolicy = Readonly<{
|
|
82
|
+
mode: "never";
|
|
83
|
+
}> | Readonly<{
|
|
84
|
+
maxAttempts: number;
|
|
85
|
+
mode: "idempotent_only";
|
|
86
|
+
}>;
|
|
87
|
+
/** Execution lifecycle and maximum wall-clock duration. */
|
|
88
|
+
export type PortableOperationExecutionPolicy = Readonly<{
|
|
89
|
+
mode: "synchronous";
|
|
90
|
+
timeoutMs: number;
|
|
91
|
+
}>;
|
|
92
|
+
/** Per-invocation transport bounds. */
|
|
93
|
+
export type PortableOperationLimits = Readonly<{
|
|
94
|
+
maxRequestBytes: number;
|
|
95
|
+
maxResponseBytes: number;
|
|
96
|
+
}>;
|
|
97
|
+
/**
|
|
98
|
+
* Complete JSON-only operation contract reviewed by a host. Executable
|
|
99
|
+
* handlers remain in a server runtime sidecar and never enter this descriptor.
|
|
100
|
+
*/
|
|
101
|
+
export type PortableOperationDeclaration = Readonly<{
|
|
102
|
+
authorization: PortableOperationAuthorization;
|
|
103
|
+
description: string;
|
|
104
|
+
effects: PortableOperationEffect;
|
|
105
|
+
execution: PortableOperationExecutionPolicy;
|
|
106
|
+
id: string;
|
|
107
|
+
idempotency: PortableOperationIdempotency;
|
|
108
|
+
input: PackageSchemaProjection;
|
|
109
|
+
limits: PortableOperationLimits;
|
|
110
|
+
output: PackageSchemaProjection;
|
|
111
|
+
retry: PortableOperationRetryPolicy;
|
|
112
|
+
title: string;
|
|
113
|
+
version: string;
|
|
114
|
+
}>;
|
|
115
|
+
export type PrincipalKind = "detached_user" | "service_principal";
|
|
116
|
+
export type ExternalAuditSubject = Readonly<{
|
|
117
|
+
issuer: string;
|
|
118
|
+
mappedCiUserId?: string;
|
|
119
|
+
subject: string;
|
|
120
|
+
}>;
|
|
121
|
+
export type GatewayCallerIdentity = Readonly<{
|
|
122
|
+
audience: readonly string[];
|
|
123
|
+
binding: string;
|
|
124
|
+
expiresAt: number;
|
|
125
|
+
installationId: string;
|
|
126
|
+
issuer: string;
|
|
127
|
+
organizationId: string;
|
|
128
|
+
principalKind: PrincipalKind;
|
|
129
|
+
requestId: string;
|
|
130
|
+
scopes: readonly string[];
|
|
131
|
+
subject: string;
|
|
132
|
+
}>;
|
|
133
|
+
export type GatewayInvocationContext = Readonly<{
|
|
134
|
+
caller: GatewayCallerIdentity;
|
|
135
|
+
correlationId: string;
|
|
136
|
+
externalAuditSubject?: ExternalAuditSubject;
|
|
137
|
+
organizationId: string;
|
|
138
|
+
}>;
|
|
139
|
+
/**
|
|
140
|
+
* Runtime dispatch validates the declared input schema before invoking a
|
|
141
|
+
* handler. The bivariant call signature lets domains retain heterogeneous,
|
|
142
|
+
* strongly typed handlers while exposing one erased operation collection.
|
|
143
|
+
*/
|
|
144
|
+
export type GatewayOperationHandler<Input = unknown, Output = unknown> = {
|
|
145
|
+
bivarianceHack(request: Readonly<{
|
|
146
|
+
context: GatewayInvocationContext;
|
|
147
|
+
/** Validated caller key; the handler owns durable replay storage. */
|
|
148
|
+
idempotencyKey?: string;
|
|
149
|
+
input: Input;
|
|
150
|
+
signal: AbortSignal;
|
|
151
|
+
}>): Promise<Output>;
|
|
152
|
+
}["bivarianceHack"];
|
|
153
|
+
export type GatewayOperationDefinition<Input = unknown, Output = unknown> = Omit<PortableOperationDeclaration, "input" | "output"> & Readonly<{
|
|
154
|
+
handler: GatewayOperationHandler<Input, Output>;
|
|
155
|
+
input: PackageSchemaProjection;
|
|
156
|
+
output: PackageSchemaProjection;
|
|
157
|
+
}>;
|
|
158
|
+
export type AiSdkOperationOptions<Input, Output, Context = unknown> = Omit<GatewayOperationDefinition, "handler" | "input" | "output" | "description"> & Readonly<{
|
|
159
|
+
tool: Tool<Input, Output, Context>;
|
|
160
|
+
/** Fills missing or dynamic descriptions; existing static strings are preserved. */
|
|
161
|
+
description?: string;
|
|
162
|
+
input?: PackageSchemaProjection;
|
|
163
|
+
output?: PackageSchemaProjection;
|
|
164
|
+
context?: (request: Parameters<GatewayOperationHandler<Input>>[0]) => unknown;
|
|
165
|
+
contextSchema?: FlexibleSchema<Context>;
|
|
166
|
+
authorize: (request: Parameters<GatewayOperationHandler<Input>>[0]) => boolean | Promise<boolean>;
|
|
167
|
+
}>;
|
|
168
|
+
export declare const defineAiSdkOperation: <Input, Output, Context = unknown>(options: AiSdkOperationOptions<Input, Output, Context>) => Promise<GatewayOperationDefinition>;
|
|
169
|
+
|
|
170
|
+
export {};
|