@kernl-sdk/protocol 0.2.1 → 0.2.4
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-check-types.log +4 -0
- package/CHANGELOG.md +38 -0
- package/LICENSE +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/language-model/item.d.ts +33 -8
- package/dist/language-model/item.d.ts.map +1 -1
- package/package.json +8 -5
- package/src/index.ts +2 -2
- package/src/language-model/item.ts +36 -8
- package/src/codec.ts +0 -22
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @kernl/protocol
|
|
2
2
|
|
|
3
|
+
## 0.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Migrate packages from GitHub Packages to npm registry.
|
|
8
|
+
|
|
9
|
+
**Breaking change for `kernl` (formerly `@kernl-sdk/core`):**
|
|
10
|
+
|
|
11
|
+
The core package has been renamed from `@kernl-sdk/core` to `kernl`. Update your imports:
|
|
12
|
+
|
|
13
|
+
```diff
|
|
14
|
+
- import { Agent, Kernl } from "@kernl-sdk/core";
|
|
15
|
+
+ import { Agent, Kernl } from "kernl";
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
All other packages remain under the `@kernl-sdk` scope and are now publicly available on npm.
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- @kernl-sdk/shared@0.1.5
|
|
22
|
+
|
|
23
|
+
## 0.2.3
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
- @kernl-sdk/shared@0.1.4
|
|
29
|
+
|
|
30
|
+
## 0.2.2
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- 2c62c0a: Migrate from @kernl to @kernl-sdk scope
|
|
35
|
+
|
|
36
|
+
All packages have been migrated to the @kernl-sdk scope for publishing to GitHub Packages under the kernl-sdk organization.
|
|
37
|
+
|
|
38
|
+
- Updated dependencies [2c62c0a]
|
|
39
|
+
- @kernl-sdk/shared@0.1.3
|
|
40
|
+
|
|
3
41
|
## 0.2.1
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2025 Andrew Jones
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* kernl
|
|
2
|
+
* kernl - Protocol
|
|
3
3
|
*
|
|
4
4
|
* Standard interfaces and types for AI model providers.
|
|
5
5
|
*/
|
|
@@ -7,5 +7,5 @@ export * from "./constants";
|
|
|
7
7
|
export * from "./language-model";
|
|
8
8
|
export * from "./embedding-model";
|
|
9
9
|
export * from "./provider";
|
|
10
|
-
export * from "./
|
|
10
|
+
export * from "./json";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* kernl
|
|
2
|
+
* kernl - Protocol
|
|
3
3
|
*
|
|
4
4
|
* Standard interfaces and types for AI model providers.
|
|
5
5
|
*/
|
|
@@ -7,4 +7,4 @@ export * from "./constants";
|
|
|
7
7
|
export * from "./language-model";
|
|
8
8
|
export * from "./embedding-model";
|
|
9
9
|
export * from "./provider";
|
|
10
|
-
export * from "./
|
|
10
|
+
export * from "./json";
|
|
@@ -40,11 +40,9 @@ export interface TextPart extends PartBase {
|
|
|
40
40
|
text: string;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* May be base64 encoded strings or binary data.
|
|
43
|
+
* Base properties for file parts.
|
|
46
44
|
*/
|
|
47
|
-
|
|
45
|
+
interface FilePartBase extends PartBase {
|
|
48
46
|
readonly kind: "file";
|
|
49
47
|
/**
|
|
50
48
|
* The IANA media type of the file, e.g. `image/png` or `audio/mp3`.
|
|
@@ -53,14 +51,40 @@ export interface FilePart extends PartBase {
|
|
|
53
51
|
*/
|
|
54
52
|
mimeType: string;
|
|
55
53
|
/**
|
|
56
|
-
*
|
|
54
|
+
* Optional filename for the file
|
|
55
|
+
*/
|
|
56
|
+
filename?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A file with inline data (base64 string or binary).
|
|
60
|
+
*/
|
|
61
|
+
export interface FilePartWithData extends FilePartBase {
|
|
62
|
+
/**
|
|
63
|
+
* File data as base64 encoded string or binary data.
|
|
57
64
|
*/
|
|
58
65
|
data: string | Uint8Array;
|
|
59
66
|
/**
|
|
60
|
-
*
|
|
67
|
+
* The `uri` property must be absent when `data` is present.
|
|
61
68
|
*/
|
|
62
|
-
|
|
69
|
+
uri?: never;
|
|
63
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* A file referenced by URI.
|
|
73
|
+
*/
|
|
74
|
+
export interface FilePartWithUri extends FilePartBase {
|
|
75
|
+
/**
|
|
76
|
+
* A URL pointing to the file's content.
|
|
77
|
+
*/
|
|
78
|
+
uri: string;
|
|
79
|
+
/**
|
|
80
|
+
* The `data` property must be absent when `uri` is present.
|
|
81
|
+
*/
|
|
82
|
+
data?: never;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A file that has been generated by the model or referenced by URI.
|
|
86
|
+
*/
|
|
87
|
+
export type FilePart = FilePartWithData | FilePartWithUri;
|
|
64
88
|
/**
|
|
65
89
|
* Represents a structured data segment (e.g., JSON) within a message or artifact.
|
|
66
90
|
*/
|
|
@@ -158,7 +182,7 @@ export interface ToolResult extends LanguageModelItemBase {
|
|
|
158
182
|
/**
|
|
159
183
|
* Result of the tool call. This is a JSON-serializable object.
|
|
160
184
|
*/
|
|
161
|
-
result:
|
|
185
|
+
result: JSONValue | null;
|
|
162
186
|
/**
|
|
163
187
|
* Error message if the tool call failed
|
|
164
188
|
*/
|
|
@@ -168,4 +192,5 @@ export interface ToolResult extends LanguageModelItemBase {
|
|
|
168
192
|
* State of a tool call execution.
|
|
169
193
|
*/
|
|
170
194
|
export type ToolCallState = typeof IN_PROGRESS | typeof COMPLETED | typeof FAILED | typeof INTERRUPTIBLE | typeof UNINTERRUPTIBLE;
|
|
195
|
+
export {};
|
|
171
196
|
//# sourceMappingURL=item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../src/language-model/item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EACL,WAAW,EACX,SAAS,EACT,MAAM,EACN,aAAa,EACb,eAAe,EAChB,MAAM,aAAa,CAAC;AAEr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G;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,OAAO,WAAW,GAClB,OAAO,SAAS,GAChB,OAAO,MAAM,GACb,OAAO,aAAa,GACpB,OAAO,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kernl-sdk/protocol",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Protocol specification for kernl",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kernl",
|
|
@@ -12,14 +12,17 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/
|
|
15
|
+
"url": "https://github.com/kernl-sdk/kernl.git",
|
|
16
16
|
"directory": "packages/protocol"
|
|
17
17
|
},
|
|
18
|
-
"homepage": "https://github.com/
|
|
18
|
+
"homepage": "https://github.com/kernl-sdk/kernl#readme",
|
|
19
19
|
"bugs": {
|
|
20
|
-
"url": "https://github.com/
|
|
20
|
+
"url": "https://github.com/kernl-sdk/kernl/issues"
|
|
21
21
|
},
|
|
22
22
|
"type": "module",
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
23
26
|
"exports": {
|
|
24
27
|
".": {
|
|
25
28
|
"types": "./dist/index.d.ts",
|
|
@@ -27,7 +30,7 @@
|
|
|
27
30
|
}
|
|
28
31
|
},
|
|
29
32
|
"dependencies": {
|
|
30
|
-
"@kernl-sdk/shared": "0.1.
|
|
33
|
+
"@kernl-sdk/shared": "0.1.5"
|
|
31
34
|
},
|
|
32
35
|
"devDependencies": {
|
|
33
36
|
"@types/json-schema": "^7.0.15",
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* kernl
|
|
2
|
+
* kernl - Protocol
|
|
3
3
|
*
|
|
4
4
|
* Standard interfaces and types for AI model providers.
|
|
5
5
|
*/
|
|
@@ -8,4 +8,4 @@ export * from "./constants";
|
|
|
8
8
|
export * from "./language-model";
|
|
9
9
|
export * from "./embedding-model";
|
|
10
10
|
export * from "./provider";
|
|
11
|
-
export * from "./
|
|
11
|
+
export * from "./json";
|
|
@@ -62,11 +62,9 @@ export interface TextPart extends PartBase {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* May be base64 encoded strings or binary data.
|
|
65
|
+
* Base properties for file parts.
|
|
68
66
|
*/
|
|
69
|
-
|
|
67
|
+
interface FilePartBase extends PartBase {
|
|
70
68
|
readonly kind: "file";
|
|
71
69
|
|
|
72
70
|
/**
|
|
@@ -77,16 +75,46 @@ export interface FilePart extends PartBase {
|
|
|
77
75
|
mimeType: string;
|
|
78
76
|
|
|
79
77
|
/**
|
|
80
|
-
*
|
|
78
|
+
* Optional filename for the file
|
|
79
|
+
*/
|
|
80
|
+
filename?: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* A file with inline data (base64 string or binary).
|
|
85
|
+
*/
|
|
86
|
+
export interface FilePartWithData extends FilePartBase {
|
|
87
|
+
/**
|
|
88
|
+
* File data as base64 encoded string or binary data.
|
|
81
89
|
*/
|
|
82
90
|
data: string | Uint8Array;
|
|
83
91
|
|
|
84
92
|
/**
|
|
85
|
-
*
|
|
93
|
+
* The `uri` property must be absent when `data` is present.
|
|
86
94
|
*/
|
|
87
|
-
|
|
95
|
+
uri?: never;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* A file referenced by URI.
|
|
100
|
+
*/
|
|
101
|
+
export interface FilePartWithUri extends FilePartBase {
|
|
102
|
+
/**
|
|
103
|
+
* A URL pointing to the file's content.
|
|
104
|
+
*/
|
|
105
|
+
uri: string;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The `data` property must be absent when `uri` is present.
|
|
109
|
+
*/
|
|
110
|
+
data?: never;
|
|
88
111
|
}
|
|
89
112
|
|
|
113
|
+
/**
|
|
114
|
+
* A file that has been generated by the model or referenced by URI.
|
|
115
|
+
*/
|
|
116
|
+
export type FilePart = FilePartWithData | FilePartWithUri;
|
|
117
|
+
|
|
90
118
|
/**
|
|
91
119
|
* Represents a structured data segment (e.g., JSON) within a message or artifact.
|
|
92
120
|
*/
|
|
@@ -214,7 +242,7 @@ export interface ToolResult extends LanguageModelItemBase {
|
|
|
214
242
|
/**
|
|
215
243
|
* Result of the tool call. This is a JSON-serializable object.
|
|
216
244
|
*/
|
|
217
|
-
result:
|
|
245
|
+
result: JSONValue | null;
|
|
218
246
|
|
|
219
247
|
/**
|
|
220
248
|
* Error message if the tool call failed
|
package/src/codec.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bidirectional codec for converting between kernl protocol types and provider-specific types.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```typescript
|
|
6
|
-
* const tools: Codec<LanguageModelTool[], ProviderTool[]> = {
|
|
7
|
-
* encode: (tools: Tool[]) => tools.map(convertToProvider),
|
|
8
|
-
* decode: () => { throw new Error("codec:unimplemented"); },
|
|
9
|
-
* };
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
export interface Codec<TKernl, TProvider> {
|
|
13
|
-
/**
|
|
14
|
-
* Transform from kernl protocol format to provider format.
|
|
15
|
-
*/
|
|
16
|
-
encode: (value: TKernl) => TProvider;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Transform from provider format to kernl protocol format.
|
|
20
|
-
*/
|
|
21
|
-
decode: (value: TProvider) => TKernl;
|
|
22
|
-
}
|