@kraken-ai/platform 0.0.1 → 0.0.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/dist/{chunk-HGJSK6MW.js → chunk-PPT6GGYL.js} +99 -2
- package/dist/chunk-PPT6GGYL.js.map +1 -0
- package/dist/cli.js +47 -19
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +3 -449
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -369
- package/dist/index.d.ts +14 -369
- package/dist/index.js +92 -611
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +498 -6
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +19 -2
- package/dist/server.d.ts +19 -2
- package/dist/server.js +451 -2
- package/dist/server.js.map +1 -1
- package/dist/types-CkknNKNr.d.cts +451 -0
- package/dist/types-CkknNKNr.d.ts +451 -0
- package/package.json +12 -12
- package/dist/chunk-HGJSK6MW.js.map +0 -1
- package/dist/connector-CumEDPfS.d.cts +0 -103
- package/dist/connector-CumEDPfS.d.ts +0 -103
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
|
|
3
|
-
/** MCP tool annotations per the MCP spec (v1.27.1) */
|
|
4
|
-
interface ToolAnnotations {
|
|
5
|
-
readonly readOnlyHint?: boolean;
|
|
6
|
-
readonly destructiveHint?: boolean;
|
|
7
|
-
readonly idempotentHint?: boolean;
|
|
8
|
-
readonly openWorldHint?: boolean;
|
|
9
|
-
}
|
|
10
|
-
/** Explicit MCP content pass-through (returned by mcpResult() helper) */
|
|
11
|
-
interface McpContent {
|
|
12
|
-
readonly __mcpPassThrough: true;
|
|
13
|
-
readonly content: ReadonlyArray<{
|
|
14
|
-
readonly type: string;
|
|
15
|
-
[key: string]: unknown;
|
|
16
|
-
}>;
|
|
17
|
-
readonly isError?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Union of valid handler return types.
|
|
21
|
-
* Prevents returning unsupported types at compile time.
|
|
22
|
-
*/
|
|
23
|
-
type ConnectorHandlerResult = string | number | boolean | Record<string, unknown> | ReadonlyArray<unknown> | McpContent | null | undefined;
|
|
24
|
-
/** Minimal context passed to resource/prompt handlers — business logic only */
|
|
25
|
-
interface ConnectorHandlerContext {
|
|
26
|
-
readonly signal: AbortSignal;
|
|
27
|
-
}
|
|
28
|
-
/** MCP-native resource content (text or binary) */
|
|
29
|
-
type ResourceContent = {
|
|
30
|
-
readonly uri: string;
|
|
31
|
-
readonly mimeType?: string;
|
|
32
|
-
readonly text: string;
|
|
33
|
-
} | {
|
|
34
|
-
readonly uri: string;
|
|
35
|
-
readonly mimeType?: string;
|
|
36
|
-
readonly blob: string;
|
|
37
|
-
};
|
|
38
|
-
/** MCP-native ReadResourceResult — returned by resource read handlers */
|
|
39
|
-
interface ReadResourceResult {
|
|
40
|
-
readonly contents: ReadonlyArray<ResourceContent>;
|
|
41
|
-
}
|
|
42
|
-
/** MCP-native prompt message content */
|
|
43
|
-
type PromptMessageContent = {
|
|
44
|
-
readonly type: "text";
|
|
45
|
-
readonly text: string;
|
|
46
|
-
} | {
|
|
47
|
-
readonly type: "image";
|
|
48
|
-
readonly data: string;
|
|
49
|
-
readonly mimeType: string;
|
|
50
|
-
};
|
|
51
|
-
/** MCP-native GetPromptResult — returned by prompt get handlers */
|
|
52
|
-
interface GetPromptResult {
|
|
53
|
-
readonly description?: string;
|
|
54
|
-
readonly messages: ReadonlyArray<{
|
|
55
|
-
readonly role: "user" | "assistant";
|
|
56
|
-
readonly content: PromptMessageContent;
|
|
57
|
-
}>;
|
|
58
|
-
}
|
|
59
|
-
/** A tool definition within a connector */
|
|
60
|
-
interface ConnectorToolDef<TInput extends z.ZodType = z.ZodType> {
|
|
61
|
-
readonly description: string;
|
|
62
|
-
readonly input: TInput;
|
|
63
|
-
readonly annotations?: ToolAnnotations;
|
|
64
|
-
handler(args: z.infer<TInput>): Promise<ConnectorHandlerResult> | ConnectorHandlerResult;
|
|
65
|
-
}
|
|
66
|
-
/** A resource definition within a connector */
|
|
67
|
-
interface ConnectorResourceDef {
|
|
68
|
-
readonly description: string;
|
|
69
|
-
readonly uri: string;
|
|
70
|
-
readonly mimeType?: string;
|
|
71
|
-
read(ctx: ConnectorHandlerContext): Promise<ReadResourceResult> | ReadResourceResult;
|
|
72
|
-
}
|
|
73
|
-
/** A prompt definition within a connector */
|
|
74
|
-
interface ConnectorPromptDef {
|
|
75
|
-
readonly description: string;
|
|
76
|
-
readonly arguments?: ReadonlyArray<{
|
|
77
|
-
readonly name: string;
|
|
78
|
-
readonly description?: string;
|
|
79
|
-
readonly required?: boolean;
|
|
80
|
-
}>;
|
|
81
|
-
get(args: Record<string, string>, ctx: ConnectorHandlerContext): Promise<GetPromptResult> | GetPromptResult;
|
|
82
|
-
}
|
|
83
|
-
/** Input to defineConnector() */
|
|
84
|
-
interface ConnectorDefinition {
|
|
85
|
-
readonly name: string;
|
|
86
|
-
readonly description?: string;
|
|
87
|
-
readonly instructions?: string;
|
|
88
|
-
readonly tools?: Record<string, ConnectorToolDef>;
|
|
89
|
-
readonly resources?: Record<string, ConnectorResourceDef>;
|
|
90
|
-
readonly prompts?: Record<string, ConnectorPromptDef>;
|
|
91
|
-
}
|
|
92
|
-
/** Output of defineConnector() — frozen, carries handlers for server builder */
|
|
93
|
-
interface PlatformConnector {
|
|
94
|
-
readonly __type: "PlatformConnector";
|
|
95
|
-
readonly name: string;
|
|
96
|
-
readonly description?: string;
|
|
97
|
-
readonly instructions?: string;
|
|
98
|
-
readonly tools?: Readonly<Record<string, ConnectorToolDef>>;
|
|
99
|
-
readonly resources?: Readonly<Record<string, ConnectorResourceDef>>;
|
|
100
|
-
readonly prompts?: Readonly<Record<string, ConnectorPromptDef>>;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export type { ConnectorDefinition as C, GetPromptResult as G, McpContent as M, PlatformConnector as P, ReadResourceResult as R, ToolAnnotations as T, ConnectorToolDef as a, ConnectorHandlerContext as b, ConnectorHandlerResult as c, ConnectorPromptDef as d, ConnectorResourceDef as e, PromptMessageContent as f, ResourceContent as g };
|