kernl 0.6.0 → 0.6.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/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +15 -0
- package/dist/agent/__tests__/concurrency.test.js +4 -4
- package/dist/agent/__tests__/run.test.js +5 -5
- package/dist/agent.d.ts +14 -14
- package/dist/agent.js +3 -3
- package/dist/api/__tests__/cursor-page.test.js +1 -1
- package/dist/api/__tests__/offset-page.test.js +1 -1
- package/dist/api/__tests__/threads.test.js +4 -4
- package/dist/api/models/index.d.ts +1 -1
- package/dist/api/models/thread.d.ts +1 -1
- package/dist/api/pagination/cursor.d.ts +1 -1
- package/dist/api/pagination/cursor.js +1 -1
- package/dist/api/pagination/offset.d.ts +1 -1
- package/dist/api/pagination/offset.js +1 -1
- package/dist/api/resources/threads/events.d.ts +2 -2
- package/dist/api/resources/threads/events.js +1 -1
- package/dist/api/resources/threads/index.d.ts +3 -3
- package/dist/api/resources/threads/index.js +2 -2
- package/dist/api/resources/threads/threads.d.ts +5 -5
- package/dist/api/resources/threads/threads.js +5 -5
- package/dist/api/resources/threads/types.d.ts +3 -3
- package/dist/api/resources/threads/utils.d.ts +4 -4
- package/dist/guardrail.d.ts +4 -4
- package/dist/index.d.ts +12 -12
- package/dist/index.js +8 -8
- package/dist/internal.d.ts +3 -3
- package/dist/internal.js +2 -2
- package/dist/kernl/index.d.ts +2 -2
- package/dist/kernl/index.js +2 -2
- package/dist/kernl/kernl.d.ts +10 -10
- package/dist/kernl/kernl.js +3 -3
- package/dist/kernl/threads.d.ts +2 -2
- package/dist/kernl/threads.js +1 -1
- package/dist/kernl.d.ts +10 -19
- package/dist/kernl.d.ts.map +1 -1
- package/dist/kernl.js +3 -25
- package/dist/lib/error.d.ts +3 -3
- package/dist/lib/logger.js +1 -1
- package/dist/lifecycle.d.ts +5 -5
- package/dist/mcp/__tests__/base.test.js +2 -2
- package/dist/mcp/__tests__/fixtures/utils.d.ts +1 -1
- package/dist/mcp/__tests__/fixtures/utils.js +1 -1
- package/dist/mcp/__tests__/integration.test.js +8 -8
- package/dist/mcp/__tests__/stdio.test.js +2 -2
- package/dist/mcp/__tests__/utils.test.js +2 -2
- package/dist/mcp/base.d.ts +2 -2
- package/dist/mcp/http.d.ts +2 -2
- package/dist/mcp/http.js +2 -2
- package/dist/mcp/sse.d.ts +2 -2
- package/dist/mcp/sse.js +2 -2
- package/dist/mcp/stdio.d.ts +2 -2
- package/dist/mcp/stdio.js +2 -2
- package/dist/mcp/types.d.ts +3 -3
- package/dist/mcp/utils.d.ts +4 -4
- package/dist/mcp/utils.js +1 -1
- package/dist/storage/__tests__/in-memory.test.js +4 -4
- package/dist/storage/base.d.ts +2 -2
- package/dist/storage/in-memory.d.ts +4 -4
- package/dist/storage/in-memory.js +2 -2
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +1 -1
- package/dist/storage/thread.d.ts +3 -3
- package/dist/task.d.ts +3 -3
- package/dist/thread/__tests__/integration.test.js +4 -4
- package/dist/thread/__tests__/mock.d.ts +1 -1
- package/dist/thread/__tests__/namespace.test.js +5 -5
- package/dist/thread/__tests__/thread.test.js +6 -6
- package/dist/thread/index.d.ts +1 -1
- package/dist/thread/index.js +1 -1
- package/dist/thread/thread.d.ts +6 -6
- package/dist/thread/thread.js +3 -3
- package/dist/thread/utils.d.ts +3 -3
- package/dist/thread/utils.js +1 -1
- package/dist/tool/__tests__/fixtures.d.ts +8 -8
- package/dist/tool/__tests__/fixtures.js +2 -2
- package/dist/tool/__tests__/tool.test.js +2 -2
- package/dist/tool/__tests__/toolkit.test.js +2 -2
- package/dist/tool/index.d.ts +3 -3
- package/dist/tool/index.js +2 -2
- package/dist/tool/tool.d.ts +2 -2
- package/dist/tool/tool.js +2 -2
- package/dist/tool/toolkit.d.ts +4 -4
- package/dist/tool/toolkit.js +1 -1
- package/dist/tool/types.d.ts +4 -4
- package/dist/trace/traces.js +2 -2
- package/dist/types/agent.d.ts +4 -4
- package/dist/types/kernl.d.ts +2 -2
- package/dist/types/thread.d.ts +5 -5
- package/package.json +5 -5
- package/src/kernl.ts +0 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kernl",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "A modern AI agent framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kernl",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@modelcontextprotocol/sdk": "^1.20.2",
|
|
36
36
|
"pino": "^9.6.0",
|
|
37
37
|
"zod": "^4.1.12",
|
|
38
|
-
"@kernl-sdk/protocol": "0.2.
|
|
39
|
-
"@kernl-sdk/shared": "^0.1.
|
|
38
|
+
"@kernl-sdk/protocol": "0.2.5",
|
|
39
|
+
"@kernl-sdk/shared": "^0.1.6"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@ai-sdk/openai": "3.0.0-beta.57",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"tsc-alias": "^1.8.10",
|
|
45
45
|
"typescript": "5.9.2",
|
|
46
46
|
"vitest": "^4.0.8",
|
|
47
|
-
"@kernl-sdk/ai": "0.2.
|
|
47
|
+
"@kernl-sdk/ai": "0.2.6"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
|
-
"build": "tsc && tsc-alias",
|
|
50
|
+
"build": "tsc && tsc-alias --resolve-full-paths",
|
|
51
51
|
"dev": "tsc --watch",
|
|
52
52
|
"lint": "eslint src/",
|
|
53
53
|
"check-types": "tsc --noEmit",
|
package/src/kernl.ts
CHANGED
|
@@ -25,8 +25,6 @@ export class Kernl extends KernlHooks<UnknownContext, AgentResponseType> {
|
|
|
25
25
|
readonly storage: KernlStorage;
|
|
26
26
|
athreads: Map<string, Thread<any, any>> = new Map(); /* active threads */
|
|
27
27
|
|
|
28
|
-
private initPromise: Promise<void> | null = null;
|
|
29
|
-
|
|
30
28
|
// --- public API ---
|
|
31
29
|
readonly threads: RThreads; /* Threads resource */
|
|
32
30
|
|
|
@@ -59,7 +57,6 @@ export class Kernl extends KernlHooks<UnknownContext, AgentResponseType> {
|
|
|
59
57
|
async spawn<TContext, TResponse extends AgentResponseType>(
|
|
60
58
|
thread: Thread<TContext, TResponse>,
|
|
61
59
|
): Promise<ThreadExecuteResult<ResolvedAgentResponse<TResponse>>> {
|
|
62
|
-
await this.ensureInitialized();
|
|
63
60
|
this.athreads.set(thread.tid, thread);
|
|
64
61
|
try {
|
|
65
62
|
return await thread.execute();
|
|
@@ -76,7 +73,6 @@ export class Kernl extends KernlHooks<UnknownContext, AgentResponseType> {
|
|
|
76
73
|
async schedule<TContext, TResponse extends AgentResponseType>(
|
|
77
74
|
thread: Thread<TContext, TResponse>,
|
|
78
75
|
): Promise<ThreadExecuteResult<ResolvedAgentResponse<TResponse>>> {
|
|
79
|
-
await this.ensureInitialized();
|
|
80
76
|
this.athreads.set(thread.tid, thread);
|
|
81
77
|
try {
|
|
82
78
|
return await thread.execute();
|
|
@@ -93,7 +89,6 @@ export class Kernl extends KernlHooks<UnknownContext, AgentResponseType> {
|
|
|
93
89
|
async *spawnStream<TContext, TResponse extends AgentResponseType>(
|
|
94
90
|
thread: Thread<TContext, TResponse>,
|
|
95
91
|
): AsyncIterable<ThreadStreamEvent> {
|
|
96
|
-
await this.ensureInitialized();
|
|
97
92
|
this.athreads.set(thread.tid, thread);
|
|
98
93
|
try {
|
|
99
94
|
yield* thread.stream();
|
|
@@ -110,7 +105,6 @@ export class Kernl extends KernlHooks<UnknownContext, AgentResponseType> {
|
|
|
110
105
|
async *scheduleStream<TContext, TResponse extends AgentResponseType>(
|
|
111
106
|
thread: Thread<TContext, TResponse>,
|
|
112
107
|
): AsyncIterable<ThreadStreamEvent> {
|
|
113
|
-
await this.ensureInitialized();
|
|
114
108
|
this.athreads.set(thread.tid, thread);
|
|
115
109
|
try {
|
|
116
110
|
yield* thread.stream();
|
|
@@ -118,23 +112,4 @@ export class Kernl extends KernlHooks<UnknownContext, AgentResponseType> {
|
|
|
118
112
|
this.athreads.delete(thread.tid);
|
|
119
113
|
}
|
|
120
114
|
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Ensure the underlying storage backend has been initialized.
|
|
124
|
-
*
|
|
125
|
-
* This is called lazily on first use so that callers do not need to worry
|
|
126
|
-
* about calling storage.init() themselves. Safe and idempotent to call
|
|
127
|
-
* multiple times; concurrent calls share the same initialization promise.
|
|
128
|
-
*/
|
|
129
|
-
private async ensureInitialized(): Promise<void> {
|
|
130
|
-
if (!this.initPromise) {
|
|
131
|
-
this.initPromise = this.storage.init().catch((error) => {
|
|
132
|
-
// allow a retry if initialization fails.
|
|
133
|
-
this.initPromise = null;
|
|
134
|
-
throw error;
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
await this.initPromise;
|
|
139
|
-
}
|
|
140
115
|
}
|