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.
Files changed (91) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/CHANGELOG.md +15 -0
  3. package/dist/agent/__tests__/concurrency.test.js +4 -4
  4. package/dist/agent/__tests__/run.test.js +5 -5
  5. package/dist/agent.d.ts +14 -14
  6. package/dist/agent.js +3 -3
  7. package/dist/api/__tests__/cursor-page.test.js +1 -1
  8. package/dist/api/__tests__/offset-page.test.js +1 -1
  9. package/dist/api/__tests__/threads.test.js +4 -4
  10. package/dist/api/models/index.d.ts +1 -1
  11. package/dist/api/models/thread.d.ts +1 -1
  12. package/dist/api/pagination/cursor.d.ts +1 -1
  13. package/dist/api/pagination/cursor.js +1 -1
  14. package/dist/api/pagination/offset.d.ts +1 -1
  15. package/dist/api/pagination/offset.js +1 -1
  16. package/dist/api/resources/threads/events.d.ts +2 -2
  17. package/dist/api/resources/threads/events.js +1 -1
  18. package/dist/api/resources/threads/index.d.ts +3 -3
  19. package/dist/api/resources/threads/index.js +2 -2
  20. package/dist/api/resources/threads/threads.d.ts +5 -5
  21. package/dist/api/resources/threads/threads.js +5 -5
  22. package/dist/api/resources/threads/types.d.ts +3 -3
  23. package/dist/api/resources/threads/utils.d.ts +4 -4
  24. package/dist/guardrail.d.ts +4 -4
  25. package/dist/index.d.ts +12 -12
  26. package/dist/index.js +8 -8
  27. package/dist/internal.d.ts +3 -3
  28. package/dist/internal.js +2 -2
  29. package/dist/kernl/index.d.ts +2 -2
  30. package/dist/kernl/index.js +2 -2
  31. package/dist/kernl/kernl.d.ts +10 -10
  32. package/dist/kernl/kernl.js +3 -3
  33. package/dist/kernl/threads.d.ts +2 -2
  34. package/dist/kernl/threads.js +1 -1
  35. package/dist/kernl.d.ts +10 -19
  36. package/dist/kernl.d.ts.map +1 -1
  37. package/dist/kernl.js +3 -25
  38. package/dist/lib/error.d.ts +3 -3
  39. package/dist/lib/logger.js +1 -1
  40. package/dist/lifecycle.d.ts +5 -5
  41. package/dist/mcp/__tests__/base.test.js +2 -2
  42. package/dist/mcp/__tests__/fixtures/utils.d.ts +1 -1
  43. package/dist/mcp/__tests__/fixtures/utils.js +1 -1
  44. package/dist/mcp/__tests__/integration.test.js +8 -8
  45. package/dist/mcp/__tests__/stdio.test.js +2 -2
  46. package/dist/mcp/__tests__/utils.test.js +2 -2
  47. package/dist/mcp/base.d.ts +2 -2
  48. package/dist/mcp/http.d.ts +2 -2
  49. package/dist/mcp/http.js +2 -2
  50. package/dist/mcp/sse.d.ts +2 -2
  51. package/dist/mcp/sse.js +2 -2
  52. package/dist/mcp/stdio.d.ts +2 -2
  53. package/dist/mcp/stdio.js +2 -2
  54. package/dist/mcp/types.d.ts +3 -3
  55. package/dist/mcp/utils.d.ts +4 -4
  56. package/dist/mcp/utils.js +1 -1
  57. package/dist/storage/__tests__/in-memory.test.js +4 -4
  58. package/dist/storage/base.d.ts +2 -2
  59. package/dist/storage/in-memory.d.ts +4 -4
  60. package/dist/storage/in-memory.js +2 -2
  61. package/dist/storage/index.d.ts +3 -3
  62. package/dist/storage/index.js +1 -1
  63. package/dist/storage/thread.d.ts +3 -3
  64. package/dist/task.d.ts +3 -3
  65. package/dist/thread/__tests__/integration.test.js +4 -4
  66. package/dist/thread/__tests__/mock.d.ts +1 -1
  67. package/dist/thread/__tests__/namespace.test.js +5 -5
  68. package/dist/thread/__tests__/thread.test.js +6 -6
  69. package/dist/thread/index.d.ts +1 -1
  70. package/dist/thread/index.js +1 -1
  71. package/dist/thread/thread.d.ts +6 -6
  72. package/dist/thread/thread.js +3 -3
  73. package/dist/thread/utils.d.ts +3 -3
  74. package/dist/thread/utils.js +1 -1
  75. package/dist/tool/__tests__/fixtures.d.ts +8 -8
  76. package/dist/tool/__tests__/fixtures.js +2 -2
  77. package/dist/tool/__tests__/tool.test.js +2 -2
  78. package/dist/tool/__tests__/toolkit.test.js +2 -2
  79. package/dist/tool/index.d.ts +3 -3
  80. package/dist/tool/index.js +2 -2
  81. package/dist/tool/tool.d.ts +2 -2
  82. package/dist/tool/tool.js +2 -2
  83. package/dist/tool/toolkit.d.ts +4 -4
  84. package/dist/tool/toolkit.js +1 -1
  85. package/dist/tool/types.d.ts +4 -4
  86. package/dist/trace/traces.js +2 -2
  87. package/dist/types/agent.d.ts +4 -4
  88. package/dist/types/kernl.d.ts +2 -2
  89. package/dist/types/thread.d.ts +5 -5
  90. package/package.json +5 -5
  91. package/src/kernl.ts +0 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kernl",
3
- "version": "0.6.0",
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.4",
39
- "@kernl-sdk/shared": "^0.1.5"
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.5"
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
  }