kernl 0.6.0 → 0.6.1
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 +5 -4
- package/CHANGELOG.md +9 -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 -10
- package/dist/kernl.js +3 -3
- 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/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> kernl@0.6.0 build /Users/andjones/Documents/projects/kernl/packages/kernl
|
|
4
|
+
> tsc && tsc-alias --resolve-full-paths
|
|
5
|
+
|
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { Agent } from "../../agent";
|
|
3
|
-
import { Kernl } from "../../kernl";
|
|
4
|
-
import { createMockModel } from "../../thread/__tests__/fixtures/mock-model";
|
|
5
|
-
import { RuntimeError } from "../../lib/error";
|
|
2
|
+
import { Agent } from "../../agent.js";
|
|
3
|
+
import { Kernl } from "../../kernl.js";
|
|
4
|
+
import { createMockModel } from "../../thread/__tests__/fixtures/mock-model.js";
|
|
5
|
+
import { RuntimeError } from "../../lib/error.js";
|
|
6
6
|
import { message } from "@kernl-sdk/protocol";
|
|
7
7
|
describe("Concurrent execution prevention", () => {
|
|
8
8
|
// (TODO): this should work
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { Agent } from "../../agent";
|
|
3
|
-
import { Kernl } from "../../kernl";
|
|
4
|
-
import { createMockModel } from "../../thread/__tests__/fixtures/mock-model";
|
|
5
|
-
import { MisconfiguredError } from "../../lib/error";
|
|
2
|
+
import { Agent } from "../../agent.js";
|
|
3
|
+
import { Kernl } from "../../kernl.js";
|
|
4
|
+
import { createMockModel } from "../../thread/__tests__/fixtures/mock-model.js";
|
|
5
|
+
import { MisconfiguredError } from "../../lib/error.js";
|
|
6
6
|
import { message } from "@kernl-sdk/protocol";
|
|
7
|
-
import { InMemoryStorage } from "../../storage/in-memory";
|
|
7
|
+
import { InMemoryStorage } from "../../storage/in-memory.js";
|
|
8
8
|
describe("Agent.run() lifecycle", () => {
|
|
9
9
|
describe("Storage wiring", () => {
|
|
10
10
|
it("should pass storage to new Thread when creating", async () => {
|
package/dist/agent.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { LanguageModel, LanguageModelItem, LanguageModelRequestSettings } from "@kernl-sdk/protocol";
|
|
2
|
-
import type { Kernl } from "./kernl";
|
|
3
|
-
import type { RThreadsListParams, RThreadCreateParams, RThreadGetOptions, RThreadHistoryParams, RThreadUpdateParams } from "./api/resources/threads/types";
|
|
4
|
-
import type { Context, UnknownContext } from "./context";
|
|
5
|
-
import { Tool } from "./tool";
|
|
6
|
-
import { BaseToolkit } from "./tool/toolkit";
|
|
7
|
-
import { InputGuardrail, OutputGuardrail, type ResolvedAgentResponse } from "./guardrail";
|
|
8
|
-
import { AgentHooks } from "./lifecycle";
|
|
9
|
-
import type { AgentConfig, AgentResponseType } from "./types/agent";
|
|
10
|
-
import type { TextResponse, ThreadExecuteOptions, ThreadExecuteResult, ThreadStreamEvent } from "./types/thread";
|
|
2
|
+
import type { Kernl } from "./kernl.js";
|
|
3
|
+
import type { RThreadsListParams, RThreadCreateParams, RThreadGetOptions, RThreadHistoryParams, RThreadUpdateParams } from "./api/resources/threads/types.js";
|
|
4
|
+
import type { Context, UnknownContext } from "./context.js";
|
|
5
|
+
import { Tool } from "./tool/index.js";
|
|
6
|
+
import { BaseToolkit } from "./tool/toolkit.js";
|
|
7
|
+
import { InputGuardrail, OutputGuardrail, type ResolvedAgentResponse } from "./guardrail.js";
|
|
8
|
+
import { AgentHooks } from "./lifecycle.js";
|
|
9
|
+
import type { AgentConfig, AgentResponseType } from "./types/agent.js";
|
|
10
|
+
import type { TextResponse, ThreadExecuteOptions, ThreadExecuteResult, ThreadStreamEvent } from "./types/thread.js";
|
|
11
11
|
export declare class Agent<TContext = UnknownContext, TResponse extends AgentResponseType = TextResponse> extends AgentHooks<TContext, TResponse> implements AgentConfig<TContext, TResponse> {
|
|
12
12
|
private kernl?;
|
|
13
13
|
id: string;
|
|
@@ -72,12 +72,12 @@ export declare class Agent<TContext = UnknownContext, TResponse extends AgentRes
|
|
|
72
72
|
* Convenience wrapper around kernl.threads that automatically filters to this agent's threads.
|
|
73
73
|
*/
|
|
74
74
|
get threads(): {
|
|
75
|
-
get: (tid: string, options?: RThreadGetOptions) => Promise<import(".").Thread | null>;
|
|
76
|
-
list: (params?: Omit<RThreadsListParams, "agentId">) => Promise<import("./api/pagination/cursor").CursorPage<import(".").Thread, RThreadsListParams>>;
|
|
75
|
+
get: (tid: string, options?: RThreadGetOptions) => Promise<import("./index.js").Thread | null>;
|
|
76
|
+
list: (params?: Omit<RThreadsListParams, "agentId">) => Promise<import("./api/pagination/cursor.js").CursorPage<import("./index.js").Thread, RThreadsListParams>>;
|
|
77
77
|
delete: (tid: string) => Promise<void>;
|
|
78
|
-
history: (tid: string, params?: RThreadHistoryParams) => Promise<import(".").ThreadEvent[]>;
|
|
79
|
-
create: (params: Omit<RThreadCreateParams, "agentId" | "model">) => Promise<import(".").Thread>;
|
|
80
|
-
update: (tid: string, patch: RThreadUpdateParams) => Promise<import(".").Thread | null>;
|
|
78
|
+
history: (tid: string, params?: RThreadHistoryParams) => Promise<import("./index.js").ThreadEvent[]>;
|
|
79
|
+
create: (params: Omit<RThreadCreateParams, "agentId" | "model">) => Promise<import("./index.js").Thread>;
|
|
80
|
+
update: (tid: string, patch: RThreadUpdateParams) => Promise<import("./index.js").Thread | null>;
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
//# sourceMappingURL=agent.d.ts.map
|
package/dist/agent.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { message, } from "@kernl-sdk/protocol";
|
|
2
|
-
import { Thread } from "./thread";
|
|
3
|
-
import { AgentHooks } from "./lifecycle";
|
|
4
|
-
import { MisconfiguredError, RuntimeError } from "./lib/error";
|
|
2
|
+
import { Thread } from "./thread/index.js";
|
|
3
|
+
import { AgentHooks } from "./lifecycle.js";
|
|
4
|
+
import { MisconfiguredError, RuntimeError } from "./lib/error.js";
|
|
5
5
|
export class Agent extends AgentHooks {
|
|
6
6
|
kernl;
|
|
7
7
|
id;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from "vitest";
|
|
2
|
-
import { CursorPage, } from "../pagination/cursor";
|
|
2
|
+
import { CursorPage, } from "../pagination/cursor.js";
|
|
3
3
|
describe("CursorPage", () => {
|
|
4
4
|
describe("construction", () => {
|
|
5
5
|
it("should initialize with response data", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from "vitest";
|
|
2
|
-
import { OffsetPage, } from "../pagination/offset";
|
|
2
|
+
import { OffsetPage, } from "../pagination/offset.js";
|
|
3
3
|
describe("OffsetPage", () => {
|
|
4
4
|
describe("construction", () => {
|
|
5
5
|
it("should initialize with response data", () => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach } from "vitest";
|
|
2
2
|
import { message, RUNNING } from "@kernl-sdk/protocol";
|
|
3
|
-
import { Agent } from "../../agent";
|
|
4
|
-
import { InMemoryThreadStore } from "../../storage/in-memory";
|
|
5
|
-
import { tevent } from "../../thread/utils";
|
|
6
|
-
import { RThreads } from "../../api/resources/threads";
|
|
3
|
+
import { Agent } from "../../agent.js";
|
|
4
|
+
import { InMemoryThreadStore } from "../../storage/in-memory.js";
|
|
5
|
+
import { tevent } from "../../thread/utils.js";
|
|
6
|
+
import { RThreads } from "../../api/resources/threads/index.js";
|
|
7
7
|
function createTestStore() {
|
|
8
8
|
const store = new InMemoryThreadStore();
|
|
9
9
|
const agents = new Map();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { MThread, MThreadModelInfo, MThreadEvent, MThreadEventBase, } from "./thread";
|
|
1
|
+
export type { MThread, MThreadModelInfo, MThreadEvent, MThreadEventBase, } from "./thread.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ThreadStore } from "../../../storage";
|
|
2
|
-
import type { MThreadEvent } from "../../../api/models";
|
|
1
|
+
import type { ThreadStore } from "../../../storage/index.js";
|
|
2
|
+
import type { MThreadEvent } from "../../../api/models/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Events subresource for threads.
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { RThreads } from "./threads";
|
|
2
|
-
export { RThreadEvents } from "./events";
|
|
3
|
-
export type { RThreadsListParams, RThreadGetOptions, RThreadHistoryParams, RThreadCreateParams, RThreadUpdateParams, } from "./types";
|
|
1
|
+
export { RThreads } from "./threads.js";
|
|
2
|
+
export { RThreadEvents } from "./events.js";
|
|
3
|
+
export type { RThreadsListParams, RThreadGetOptions, RThreadHistoryParams, RThreadCreateParams, RThreadUpdateParams, } from "./types.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RThreads } from "./threads";
|
|
2
|
-
export { RThreadEvents } from "./events";
|
|
1
|
+
export { RThreads } from "./threads.js";
|
|
2
|
+
export { RThreadEvents } from "./events.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ThreadStore } from "../../../storage";
|
|
2
|
-
import type { MThread, MThreadEvent } from "../../../api/models";
|
|
3
|
-
import { CursorPage } from "../../../api/pagination/cursor";
|
|
4
|
-
import { RThreadEvents } from "./events";
|
|
5
|
-
import type { RThreadCreateParams, RThreadGetOptions, RThreadHistoryParams, RThreadsListParams, RThreadUpdateParams } from "./types";
|
|
1
|
+
import type { ThreadStore } from "../../../storage/index.js";
|
|
2
|
+
import type { MThread, MThreadEvent } from "../../../api/models/index.js";
|
|
3
|
+
import { CursorPage } from "../../../api/pagination/cursor.js";
|
|
4
|
+
import { RThreadEvents } from "./events.js";
|
|
5
|
+
import type { RThreadCreateParams, RThreadGetOptions, RThreadHistoryParams, RThreadsListParams, RThreadUpdateParams } from "./types.js";
|
|
6
6
|
/**
|
|
7
7
|
* Threads resource.
|
|
8
8
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { isPublicEvent } from "../../../thread/utils";
|
|
2
|
-
import { Context } from "../../../context";
|
|
1
|
+
import { isPublicEvent } from "../../../thread/utils.js";
|
|
2
|
+
import { Context } from "../../../context.js";
|
|
3
3
|
import { randomID } from "@kernl-sdk/shared/lib";
|
|
4
4
|
import { RUNNING } from "@kernl-sdk/protocol";
|
|
5
|
-
import { CursorPage } from "../../../api/pagination/cursor";
|
|
6
|
-
import { RThreadEvents } from "./events";
|
|
7
|
-
import { MThreadCodec, ThreadsFilterCodec, ThreadsOrderCodec } from "./utils";
|
|
5
|
+
import { CursorPage } from "../../../api/pagination/cursor.js";
|
|
6
|
+
import { RThreadEvents } from "./events.js";
|
|
7
|
+
import { MThreadCodec, ThreadsFilterCodec, ThreadsOrderCodec } from "./utils.js";
|
|
8
8
|
/**
|
|
9
9
|
* Threads resource.
|
|
10
10
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ThreadState } from "../../../types/thread";
|
|
2
|
-
import type { SortOrder } from "../../../storage";
|
|
3
|
-
import type { CursorPageParams } from "../../../api/pagination/cursor";
|
|
1
|
+
import type { ThreadState } from "../../../types/thread.js";
|
|
2
|
+
import type { SortOrder } from "../../../storage/index.js";
|
|
3
|
+
import type { CursorPageParams } from "../../../api/pagination/cursor.js";
|
|
4
4
|
export interface RThreadHistoryParams {
|
|
5
5
|
/**
|
|
6
6
|
* Only return events with seq greater than this value.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Codec } from "@kernl-sdk/shared/lib";
|
|
2
|
-
import type { Thread } from "../../../thread";
|
|
3
|
-
import type { ThreadFilter, ThreadListOptions } from "../../../storage";
|
|
4
|
-
import type { MThread } from "../../../api/models";
|
|
5
|
-
import type { RThreadsListParams } from "./types";
|
|
2
|
+
import type { Thread } from "../../../thread/index.js";
|
|
3
|
+
import type { ThreadFilter, ThreadListOptions } from "../../../storage/index.js";
|
|
4
|
+
import type { MThread } from "../../../api/models/index.js";
|
|
5
|
+
import type { RThreadsListParams } from "./types.js";
|
|
6
6
|
/**
|
|
7
7
|
* Converts an internal `Thread` runtime instance into an `MThread` model.
|
|
8
8
|
*/
|
package/dist/guardrail.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z, type ZodType } from "zod";
|
|
2
2
|
import { LanguageModelResponse } from "@kernl-sdk/protocol";
|
|
3
|
-
import { Agent } from "./agent";
|
|
4
|
-
import { Context, UnknownContext } from "./context";
|
|
5
|
-
import type { AgentResponseType } from "./types/agent";
|
|
6
|
-
import type { TextResponse, ThreadEvent } from "./types/thread";
|
|
3
|
+
import { Agent } from "./agent.js";
|
|
4
|
+
import { Context, UnknownContext } from "./context.js";
|
|
5
|
+
import type { AgentResponseType } from "./types/agent.js";
|
|
6
|
+
import type { TextResponse, ThreadEvent } from "./types/thread.js";
|
|
7
7
|
/**
|
|
8
8
|
* Resolves the agent output type based on the response type.
|
|
9
9
|
* - If TResponse is "text" → output is string
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { Kernl } from "./kernl";
|
|
2
|
-
export type { KernlOptions, StorageOptions, AgentRegistry, ModelRegistry, } from "./types/kernl";
|
|
3
|
-
export { Agent } from "./agent";
|
|
4
|
-
export { Context } from "./context";
|
|
5
|
-
export { tool, Toolkit, FunctionToolkit, MCPToolkit } from "./tool";
|
|
6
|
-
export { MCPServerSSE } from "./mcp/sse";
|
|
7
|
-
export { MCPServerStdio } from "./mcp/stdio";
|
|
8
|
-
export { MCPServerStreamableHttp } from "./mcp/http";
|
|
9
|
-
export type { MThread as Thread, MThreadEvent as ThreadEvent, MThreadEventBase as ThreadEventBase, } from "./api/models";
|
|
10
|
-
export type { RThreadsListParams as ThreadsListParams, RThreadGetOptions as ThreadGetOptions, RThreadHistoryParams as ThreadHistoryParams, RThreadCreateParams as ThreadCreateParams, RThreadUpdateParams as ThreadUpdateParams, } from "./api/resources/threads";
|
|
11
|
-
export { THREAD_STATES, type ThreadState, type PublicThreadEvent, } from "./types/thread";
|
|
12
|
-
export type { ThreadStore, NewThread, ThreadUpdate, ThreadFilter, ThreadHistoryOptions, ThreadInclude, ThreadListOptions, SortOrder, KernlStorage, Transaction, } from "./storage";
|
|
1
|
+
export { Kernl } from "./kernl.js";
|
|
2
|
+
export type { KernlOptions, StorageOptions, AgentRegistry, ModelRegistry, } from "./types/kernl.js";
|
|
3
|
+
export { Agent } from "./agent.js";
|
|
4
|
+
export { Context } from "./context.js";
|
|
5
|
+
export { tool, Toolkit, FunctionToolkit, MCPToolkit } from "./tool/index.js";
|
|
6
|
+
export { MCPServerSSE } from "./mcp/sse.js";
|
|
7
|
+
export { MCPServerStdio } from "./mcp/stdio.js";
|
|
8
|
+
export { MCPServerStreamableHttp } from "./mcp/http.js";
|
|
9
|
+
export type { MThread as Thread, MThreadEvent as ThreadEvent, MThreadEventBase as ThreadEventBase, } from "./api/models/index.js";
|
|
10
|
+
export type { RThreadsListParams as ThreadsListParams, RThreadGetOptions as ThreadGetOptions, RThreadHistoryParams as ThreadHistoryParams, RThreadCreateParams as ThreadCreateParams, RThreadUpdateParams as ThreadUpdateParams, } from "./api/resources/threads/index.js";
|
|
11
|
+
export { THREAD_STATES, type ThreadState, type PublicThreadEvent, } from "./types/thread.js";
|
|
12
|
+
export type { ThreadStore, NewThread, ThreadUpdate, ThreadFilter, ThreadHistoryOptions, ThreadInclude, ThreadListOptions, SortOrder, KernlStorage, Transaction, } from "./storage/index.js";
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { Kernl } from "./kernl";
|
|
2
|
-
export { Agent } from "./agent";
|
|
3
|
-
export { Context } from "./context";
|
|
1
|
+
export { Kernl } from "./kernl.js";
|
|
2
|
+
export { Agent } from "./agent.js";
|
|
3
|
+
export { Context } from "./context.js";
|
|
4
4
|
// --- tools --
|
|
5
|
-
export { tool, Toolkit, FunctionToolkit, MCPToolkit } from "./tool";
|
|
6
|
-
export { MCPServerSSE } from "./mcp/sse";
|
|
7
|
-
export { MCPServerStdio } from "./mcp/stdio";
|
|
8
|
-
export { MCPServerStreamableHttp } from "./mcp/http";
|
|
5
|
+
export { tool, Toolkit, FunctionToolkit, MCPToolkit } from "./tool/index.js";
|
|
6
|
+
export { MCPServerSSE } from "./mcp/sse.js";
|
|
7
|
+
export { MCPServerStdio } from "./mcp/stdio.js";
|
|
8
|
+
export { MCPServerStreamableHttp } from "./mcp/http.js";
|
|
9
9
|
// --- thread state enums ---
|
|
10
|
-
export { THREAD_STATES, } from "./types/thread";
|
|
10
|
+
export { THREAD_STATES, } from "./types/thread.js";
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Thread } from "./thread/thread";
|
|
2
|
-
export type { IThread, ThreadEvent, ThreadEventBase, ThreadEventInner, ThreadSystemEvent, ThreadState, PublicThreadEvent, } from "./types/thread";
|
|
3
|
-
export { THREAD_STATES } from "./types/thread";
|
|
1
|
+
export { Thread } from "./thread/thread.js";
|
|
2
|
+
export type { IThread, ThreadEvent, ThreadEventBase, ThreadEventInner, ThreadSystemEvent, ThreadState, PublicThreadEvent, } from "./types/thread.js";
|
|
3
|
+
export { THREAD_STATES } from "./types/thread.js";
|
|
4
4
|
//# sourceMappingURL=internal.d.ts.map
|
package/dist/internal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Thread } from "./thread/thread";
|
|
2
|
-
export { THREAD_STATES } from "./types/thread";
|
|
1
|
+
export { Thread } from "./thread/thread.js";
|
|
2
|
+
export { THREAD_STATES } from "./types/thread.js";
|
package/dist/kernl/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Kernl } from "./kernl";
|
|
2
|
-
export { ThreadsResource, type ThreadsListParams, type ThreadGetOptions } from "./threads";
|
|
1
|
+
export { Kernl } from "./kernl.js";
|
|
2
|
+
export { ThreadsResource, type ThreadsListParams, type ThreadGetOptions } from "./threads.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/kernl/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Kernl } from "./kernl";
|
|
2
|
-
export { ThreadsResource } from "./threads";
|
|
1
|
+
export { Kernl } from "./kernl.js";
|
|
2
|
+
export { ThreadsResource } from "./threads.js";
|
package/dist/kernl/kernl.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Agent } from "../agent";
|
|
2
|
-
import { UnknownContext } from "../context";
|
|
3
|
-
import { KernlHooks } from "../lifecycle";
|
|
4
|
-
import type { Thread } from "../thread";
|
|
5
|
-
import type { ResolvedAgentResponse } from "../guardrail";
|
|
6
|
-
import { type KernlStorage } from "../storage";
|
|
7
|
-
import type { KernlOptions } from "../types/kernl";
|
|
8
|
-
import type { ThreadExecuteResult, ThreadStreamEvent } from "../types/thread";
|
|
9
|
-
import type { AgentResponseType } from "../types/agent";
|
|
10
|
-
import { ThreadsResource } from "./threads";
|
|
1
|
+
import { Agent } from "../agent.js";
|
|
2
|
+
import { UnknownContext } from "../context.js";
|
|
3
|
+
import { KernlHooks } from "../lifecycle.js";
|
|
4
|
+
import type { Thread } from "../thread/index.js";
|
|
5
|
+
import type { ResolvedAgentResponse } from "../guardrail.js";
|
|
6
|
+
import { type KernlStorage } from "../storage/index.js";
|
|
7
|
+
import type { KernlOptions } from "../types/kernl.js";
|
|
8
|
+
import type { ThreadExecuteResult, ThreadStreamEvent } from "../types/thread.js";
|
|
9
|
+
import type { AgentResponseType } from "../types/agent.js";
|
|
10
|
+
import { ThreadsResource } from "./threads.js";
|
|
11
11
|
/**
|
|
12
12
|
* The kernl - manages agent processes, scheduling, and task lifecycle.
|
|
13
13
|
*
|
package/dist/kernl/kernl.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { KernlHooks } from "../lifecycle";
|
|
2
|
-
import { InMemoryStorage } from "../storage";
|
|
3
|
-
import { ThreadsResource } from "./threads";
|
|
1
|
+
import { KernlHooks } from "../lifecycle.js";
|
|
2
|
+
import { InMemoryStorage } from "../storage/index.js";
|
|
3
|
+
import { ThreadsResource } from "./threads.js";
|
|
4
4
|
/**
|
|
5
5
|
* The kernl - manages agent processes, scheduling, and task lifecycle.
|
|
6
6
|
*
|
package/dist/kernl/threads.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ThreadStore } from "../storage";
|
|
2
|
-
import type { ThreadResource, PublicThreadEvent } from "../types/thread";
|
|
1
|
+
import type { ThreadStore } from "../storage/index.js";
|
|
2
|
+
import type { ThreadResource, PublicThreadEvent } from "../types/thread.js";
|
|
3
3
|
/**
|
|
4
4
|
* Threads resource - provides a clean API for managing threads.
|
|
5
5
|
*
|
package/dist/kernl/threads.js
CHANGED
package/dist/kernl.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Agent } from "./agent";
|
|
2
|
-
import { UnknownContext } from "./context";
|
|
3
|
-
import { KernlHooks } from "./lifecycle";
|
|
4
|
-
import type { Thread } from "./thread";
|
|
5
|
-
import type { ResolvedAgentResponse } from "./guardrail";
|
|
6
|
-
import { type KernlStorage } from "./storage";
|
|
7
|
-
import { RThreads } from "./api/resources/threads";
|
|
8
|
-
import type { KernlOptions } from "./types/kernl";
|
|
9
|
-
import type { ThreadExecuteResult, ThreadStreamEvent } from "./types/thread";
|
|
10
|
-
import type { AgentResponseType } from "./types/agent";
|
|
1
|
+
import { Agent } from "./agent.js";
|
|
2
|
+
import { UnknownContext } from "./context.js";
|
|
3
|
+
import { KernlHooks } from "./lifecycle.js";
|
|
4
|
+
import type { Thread } from "./thread/index.js";
|
|
5
|
+
import type { ResolvedAgentResponse } from "./guardrail.js";
|
|
6
|
+
import { type KernlStorage } from "./storage/index.js";
|
|
7
|
+
import { RThreads } from "./api/resources/threads/index.js";
|
|
8
|
+
import type { KernlOptions } from "./types/kernl.js";
|
|
9
|
+
import type { ThreadExecuteResult, ThreadStreamEvent } from "./types/thread.js";
|
|
10
|
+
import type { AgentResponseType } from "./types/agent.js";
|
|
11
11
|
/**
|
|
12
12
|
* The kernl - manages agent processes, scheduling, and task lifecycle.
|
|
13
13
|
*
|
package/dist/kernl.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { KernlHooks } from "./lifecycle";
|
|
2
|
-
import { InMemoryStorage } from "./storage";
|
|
3
|
-
import { RThreads } from "./api/resources/threads";
|
|
1
|
+
import { KernlHooks } from "./lifecycle.js";
|
|
2
|
+
import { InMemoryStorage } from "./storage/index.js";
|
|
3
|
+
import { RThreads } from "./api/resources/threads/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* The kernl - manages agent processes, scheduling, and task lifecycle.
|
|
6
6
|
*
|
package/dist/lib/error.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { InputGuardrailResult, OutputGuardrailMetadata, OutputGuardrailResult } from "../guardrail";
|
|
1
|
+
import { InputGuardrailResult, OutputGuardrailMetadata, OutputGuardrailResult } from "../guardrail.js";
|
|
2
2
|
type SerializedThread = any;
|
|
3
|
-
import { AgentResponseType } from "../types/agent";
|
|
4
|
-
import { TextResponse } from "../types/thread";
|
|
3
|
+
import { AgentResponseType } from "../types/agent.js";
|
|
4
|
+
import { TextResponse } from "../types/thread.js";
|
|
5
5
|
/**
|
|
6
6
|
* Abstract base class for all `kernl` errors
|
|
7
7
|
* Requires subclasses to implement JSON serialization
|
package/dist/lib/logger.js
CHANGED
package/dist/lifecycle.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { EventEmitter } from "node:events";
|
|
2
|
-
import { Agent } from "./agent";
|
|
3
|
-
import { Context, UnknownContext } from "./context";
|
|
4
|
-
import { Tool } from "./tool";
|
|
2
|
+
import { Agent } from "./agent.js";
|
|
3
|
+
import { Context, UnknownContext } from "./context.js";
|
|
4
|
+
import { Tool } from "./tool/index.js";
|
|
5
5
|
import type { ToolCall } from "@kernl-sdk/protocol";
|
|
6
|
-
import { AgentResponseType } from "./types/agent";
|
|
7
|
-
import { TextResponse } from "./types/thread";
|
|
6
|
+
import { AgentResponseType } from "./types/agent.js";
|
|
7
|
+
import { TextResponse } from "./types/thread.js";
|
|
8
8
|
export type EventEmitterEvents = Record<string, any[]>;
|
|
9
9
|
/**
|
|
10
10
|
* Generic typed event emitter that wraps Node's EventEmitter with type safety
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from "vitest";
|
|
2
|
-
import { BaseMCPServer } from "../base";
|
|
3
|
-
import { logger } from "../../lib/logger";
|
|
2
|
+
import { BaseMCPServer } from "../base.js";
|
|
3
|
+
import { logger } from "../../lib/logger.js";
|
|
4
4
|
// Create a minimal concrete implementation for testing
|
|
5
5
|
class TestMCPServer extends BaseMCPServer {
|
|
6
6
|
id;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { MCPServerStdio } from "../stdio";
|
|
4
|
-
import { MCPToolkit } from "../../tool/toolkit";
|
|
5
|
-
import { FunctionToolkit } from "../../tool/toolkit";
|
|
6
|
-
import { Agent } from "../../agent";
|
|
7
|
-
import { Context } from "../../context";
|
|
8
|
-
import { tool } from "../../tool";
|
|
3
|
+
import { MCPServerStdio } from "../stdio.js";
|
|
4
|
+
import { MCPToolkit } from "../../tool/toolkit.js";
|
|
5
|
+
import { FunctionToolkit } from "../../tool/toolkit.js";
|
|
6
|
+
import { Agent } from "../../agent.js";
|
|
7
|
+
import { Context } from "../../context.js";
|
|
8
|
+
import { tool } from "../../tool/index.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
|
-
import { createMCPToolStaticFilter } from "../utils";
|
|
11
|
-
import { createMockModel } from "../../thread/__tests__/fixtures/mock-model";
|
|
10
|
+
import { createMCPToolStaticFilter } from "../utils.js";
|
|
11
|
+
import { createMockModel } from "../../thread/__tests__/fixtures/mock-model.js";
|
|
12
12
|
const TEST_SERVER = path.join(__dirname, "fixtures", "server.ts");
|
|
13
13
|
// Mock model for tests that only need toolkit functionality
|
|
14
14
|
const mockModel = createMockModel(async () => ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { MCPServerStdio } from "../stdio";
|
|
3
|
-
import { withMCPServer, createMCPServer } from "./fixtures/utils";
|
|
2
|
+
import { MCPServerStdio } from "../stdio.js";
|
|
3
|
+
import { withMCPServer, createMCPServer } from "./fixtures/utils.js";
|
|
4
4
|
import path from "path";
|
|
5
5
|
const TEST_SERVER = path.join(__dirname, "fixtures", "server.ts");
|
|
6
6
|
describe("MCPServerStdio", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from "vitest";
|
|
2
|
-
import { mcpToFunctionTool, createMCPToolStaticFilter } from "../utils";
|
|
3
|
-
import { Context } from "../../context";
|
|
2
|
+
import { mcpToFunctionTool, createMCPToolStaticFilter } from "../utils.js";
|
|
3
|
+
import { Context } from "../../context.js";
|
|
4
4
|
describe("mcpToFunctionTool", () => {
|
|
5
5
|
// Create a mock MCP server
|
|
6
6
|
const createMockServer = () => ({
|
package/dist/mcp/base.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Logger } from "../lib/logger";
|
|
2
|
-
import { MCPTool, MCPToolFilter, CallToolResultContent } from "./types";
|
|
1
|
+
import { Logger } from "../lib/logger.js";
|
|
2
|
+
import { MCPTool, MCPToolFilter, CallToolResultContent } from "./types.js";
|
|
3
3
|
export declare const DEFAULT_STDIO_MCP_CLIENT_LOGGER_NAME = "kernl:stdio-mcp-client";
|
|
4
4
|
export declare const DEFAULT_SSE_MCP_CLIENT_LOGGER_NAME = "kernl:sse-mcp-client";
|
|
5
5
|
export declare const DEFAULT_STREAMABLE_HTTP_MCP_CLIENT_LOGGER_NAME = "kernl:streamable-http-mcp-client";
|
package/dist/mcp/http.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
|
-
import { BaseMCPServer } from "./base";
|
|
3
|
-
import type { MCPTool, CallToolResultContent, MCPServerStreamableHttpOptions, InitializeResult } from "./types";
|
|
2
|
+
import { BaseMCPServer } from "./base.js";
|
|
3
|
+
import type { MCPTool, CallToolResultContent, MCPServerStreamableHttpOptions, InitializeResult } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* MCP server client that communicates over streamable HTTP protocol.
|
|
6
6
|
*/
|
package/dist/mcp/http.js
CHANGED
|
@@ -2,8 +2,8 @@ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
|
2
2
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
3
3
|
import { DEFAULT_REQUEST_TIMEOUT_MSEC } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
4
4
|
import { ListToolsResultSchema, CallToolResultSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
-
import { getLogger } from "../lib/logger";
|
|
6
|
-
import { BaseMCPServer, DEFAULT_STREAMABLE_HTTP_MCP_CLIENT_LOGGER_NAME, } from "./base";
|
|
5
|
+
import { getLogger } from "../lib/logger.js";
|
|
6
|
+
import { BaseMCPServer, DEFAULT_STREAMABLE_HTTP_MCP_CLIENT_LOGGER_NAME, } from "./base.js";
|
|
7
7
|
/**
|
|
8
8
|
* MCP server client that communicates over streamable HTTP protocol.
|
|
9
9
|
*/
|