@nextclaw/kernel 0.1.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/LICENSE +21 -0
- package/dist/index.d.ts +286 -0
- package/dist/index.js +251 -0
- package/package.json +30 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NextClaw contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { NcpMessage } from "@nextclaw/ncp";
|
|
2
|
+
|
|
3
|
+
//#region src/types/entity-ids.types.d.ts
|
|
4
|
+
type AgentId = string;
|
|
5
|
+
type TaskId = string;
|
|
6
|
+
type SessionId = string;
|
|
7
|
+
type ToolId = string;
|
|
8
|
+
type SkillId = string;
|
|
9
|
+
type LlmProviderId = string;
|
|
10
|
+
type AutomationId = string;
|
|
11
|
+
type ChannelId = string;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/types/agent.types.d.ts
|
|
14
|
+
type AgentRecord = {
|
|
15
|
+
id: AgentId;
|
|
16
|
+
name: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
defaultProviderId?: LlmProviderId | null;
|
|
19
|
+
enabledSkillIds: SkillId[];
|
|
20
|
+
enabledToolIds: ToolId[];
|
|
21
|
+
metadata: Record<string, unknown>;
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/managers/agent.manager.d.ts
|
|
25
|
+
declare class AgentManager {
|
|
26
|
+
readonly listAgents: () => never;
|
|
27
|
+
readonly getAgent: (agentId: AgentId) => never;
|
|
28
|
+
readonly requireAgent: (agentId: AgentId) => never;
|
|
29
|
+
readonly saveAgent: (agent: AgentRecord) => never;
|
|
30
|
+
readonly removeAgent: (agentId: AgentId) => never;
|
|
31
|
+
readonly attachSkill: (agentId: AgentId, skillId: SkillId) => never;
|
|
32
|
+
readonly detachSkill: (agentId: AgentId, skillId: SkillId) => never;
|
|
33
|
+
readonly attachTool: (agentId: AgentId, toolId: ToolId) => never;
|
|
34
|
+
readonly detachTool: (agentId: AgentId, toolId: ToolId) => never;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/types/automation.types.d.ts
|
|
38
|
+
type AutomationTrigger = {
|
|
39
|
+
kind: "cron";
|
|
40
|
+
expression: string;
|
|
41
|
+
} | {
|
|
42
|
+
kind: "manual";
|
|
43
|
+
} | {
|
|
44
|
+
kind: "event";
|
|
45
|
+
event: string;
|
|
46
|
+
};
|
|
47
|
+
type AutomationRecord = {
|
|
48
|
+
id: AutomationId;
|
|
49
|
+
name: string;
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
trigger: AutomationTrigger;
|
|
52
|
+
agentId: AgentId;
|
|
53
|
+
sessionId?: SessionId | null;
|
|
54
|
+
inputTemplate?: unknown;
|
|
55
|
+
metadata: Record<string, unknown>;
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/managers/automation.manager.d.ts
|
|
59
|
+
declare class AutomationManager {
|
|
60
|
+
readonly listAutomations: () => never;
|
|
61
|
+
readonly getAutomation: (automationId: AutomationId) => never;
|
|
62
|
+
readonly requireAutomation: (automationId: AutomationId) => never;
|
|
63
|
+
readonly saveAutomation: (automation: AutomationRecord) => never;
|
|
64
|
+
readonly enableAutomation: (automationId: AutomationId) => never;
|
|
65
|
+
readonly disableAutomation: (automationId: AutomationId) => never;
|
|
66
|
+
readonly deleteAutomation: (automationId: AutomationId) => never;
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/types/channel.types.d.ts
|
|
70
|
+
type ChannelDirection = "inbound" | "outbound" | "bidirectional";
|
|
71
|
+
type ChannelRecord = {
|
|
72
|
+
id: ChannelId;
|
|
73
|
+
name: string;
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
direction: ChannelDirection;
|
|
76
|
+
metadata: Record<string, unknown>;
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/managers/channel.manager.d.ts
|
|
80
|
+
declare class ChannelManager {
|
|
81
|
+
readonly listChannels: () => never;
|
|
82
|
+
readonly getChannel: (channelId: ChannelId) => never;
|
|
83
|
+
readonly requireChannel: (channelId: ChannelId) => never;
|
|
84
|
+
readonly saveChannel: (channel: ChannelRecord) => never;
|
|
85
|
+
readonly enableChannel: (channelId: ChannelId) => never;
|
|
86
|
+
readonly disableChannel: (channelId: ChannelId) => never;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/types/context.types.d.ts
|
|
90
|
+
type ContextRecord = {
|
|
91
|
+
sessionId: SessionId;
|
|
92
|
+
taskId?: TaskId | null;
|
|
93
|
+
agentId?: AgentId | null;
|
|
94
|
+
workspace?: string | null;
|
|
95
|
+
memoryRefs: string[];
|
|
96
|
+
selectedSkillIds: SkillId[];
|
|
97
|
+
selectedToolIds: ToolId[];
|
|
98
|
+
selectedProviderId?: LlmProviderId | null;
|
|
99
|
+
variables: Record<string, unknown>;
|
|
100
|
+
};
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/types/task.types.d.ts
|
|
103
|
+
type TaskStatus = "pending" | "running" | "blocked" | "completed" | "failed" | "cancelled";
|
|
104
|
+
type TaskRecord = {
|
|
105
|
+
id: TaskId;
|
|
106
|
+
title: string;
|
|
107
|
+
status: TaskStatus;
|
|
108
|
+
agentId: AgentId;
|
|
109
|
+
sessionId: SessionId;
|
|
110
|
+
input: unknown;
|
|
111
|
+
output?: unknown;
|
|
112
|
+
error?: string | null;
|
|
113
|
+
createdAt: string;
|
|
114
|
+
updatedAt: string;
|
|
115
|
+
metadata: Record<string, unknown>;
|
|
116
|
+
};
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/types/session.types.d.ts
|
|
119
|
+
type SessionMessage = NcpMessage;
|
|
120
|
+
type SessionRecord = {
|
|
121
|
+
id: SessionId;
|
|
122
|
+
title?: string;
|
|
123
|
+
agentId?: AgentId | null;
|
|
124
|
+
taskIds: TaskId[];
|
|
125
|
+
contextVersion: number;
|
|
126
|
+
createdAt: string;
|
|
127
|
+
updatedAt: string;
|
|
128
|
+
metadata: Record<string, unknown>;
|
|
129
|
+
};
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/managers/session.manager.d.ts
|
|
132
|
+
declare class SessionManager {
|
|
133
|
+
readonly listSessions: () => never;
|
|
134
|
+
readonly getSession: (sessionId: SessionId) => never;
|
|
135
|
+
readonly requireSession: (sessionId: SessionId) => never;
|
|
136
|
+
readonly createSession: (input?: {
|
|
137
|
+
title?: string;
|
|
138
|
+
agentId?: AgentId | null;
|
|
139
|
+
metadata?: Record<string, unknown>;
|
|
140
|
+
}) => never;
|
|
141
|
+
readonly saveSession: (session: SessionRecord) => never;
|
|
142
|
+
readonly appendMessage: (sessionId: SessionId, message: SessionMessage) => never;
|
|
143
|
+
readonly attachTask: (sessionId: SessionId, taskId: TaskId) => never;
|
|
144
|
+
readonly closeSession: (sessionId: SessionId) => never;
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/managers/context-builder.manager.d.ts
|
|
148
|
+
declare class ContextBuilder {
|
|
149
|
+
private readonly sessions;
|
|
150
|
+
constructor(sessions: SessionManager);
|
|
151
|
+
readonly build: (input: {
|
|
152
|
+
sessionId: SessionId;
|
|
153
|
+
task?: TaskRecord | null;
|
|
154
|
+
agent: AgentRecord;
|
|
155
|
+
}) => ContextRecord;
|
|
156
|
+
}
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/types/llm-provider.types.d.ts
|
|
159
|
+
type LlmProviderRecord = {
|
|
160
|
+
id: LlmProviderId;
|
|
161
|
+
name: string;
|
|
162
|
+
modelIds: string[];
|
|
163
|
+
enabled: boolean;
|
|
164
|
+
metadata: Record<string, unknown>;
|
|
165
|
+
};
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/managers/llm-provider.manager.d.ts
|
|
168
|
+
declare class LlmProviderManager {
|
|
169
|
+
readonly listProviders: () => never;
|
|
170
|
+
readonly getProvider: (providerId: LlmProviderId) => never;
|
|
171
|
+
readonly requireProvider: (providerId: LlmProviderId) => never;
|
|
172
|
+
readonly saveProvider: (provider: LlmProviderRecord) => never;
|
|
173
|
+
readonly enableProvider: (providerId: LlmProviderId) => never;
|
|
174
|
+
readonly disableProvider: (providerId: LlmProviderId) => never;
|
|
175
|
+
readonly selectProvider: (input: {
|
|
176
|
+
agent: AgentRecord;
|
|
177
|
+
context: ContextRecord;
|
|
178
|
+
}) => never;
|
|
179
|
+
}
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/types/skill.types.d.ts
|
|
182
|
+
type SkillRecord = {
|
|
183
|
+
id: SkillId;
|
|
184
|
+
name: string;
|
|
185
|
+
description: string;
|
|
186
|
+
toolIds: ToolId[];
|
|
187
|
+
enabled: boolean;
|
|
188
|
+
metadata: Record<string, unknown>;
|
|
189
|
+
};
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/managers/skill.manager.d.ts
|
|
192
|
+
declare class SkillManager {
|
|
193
|
+
readonly listSkills: () => never;
|
|
194
|
+
readonly getSkill: (skillId: SkillId) => never;
|
|
195
|
+
readonly requireSkill: (skillId: SkillId) => never;
|
|
196
|
+
readonly saveSkill: (skill: SkillRecord) => never;
|
|
197
|
+
readonly enableSkill: (skillId: SkillId) => never;
|
|
198
|
+
readonly disableSkill: (skillId: SkillId) => never;
|
|
199
|
+
readonly resolveSkills: (skillIds: SkillId[]) => never;
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/managers/task.manager.d.ts
|
|
203
|
+
declare class TaskManager {
|
|
204
|
+
readonly listTasks: () => never;
|
|
205
|
+
readonly getTask: (taskId: TaskId) => never;
|
|
206
|
+
readonly requireTask: (taskId: TaskId) => never;
|
|
207
|
+
readonly createTask: (input: {
|
|
208
|
+
title: string;
|
|
209
|
+
agentId: AgentId;
|
|
210
|
+
sessionId: SessionId;
|
|
211
|
+
input: unknown;
|
|
212
|
+
metadata?: Record<string, unknown>;
|
|
213
|
+
}) => never;
|
|
214
|
+
readonly saveTask: (task: TaskRecord) => never;
|
|
215
|
+
readonly updateTaskStatus: (taskId: TaskId, status: TaskStatus) => never;
|
|
216
|
+
readonly completeTask: (taskId: TaskId, output: unknown) => never;
|
|
217
|
+
readonly failTask: (taskId: TaskId, error: string) => never;
|
|
218
|
+
readonly cancelTask: (taskId: TaskId) => never;
|
|
219
|
+
}
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/types/tool.types.d.ts
|
|
222
|
+
type ToolRecord = {
|
|
223
|
+
id: ToolId;
|
|
224
|
+
name: string;
|
|
225
|
+
description: string;
|
|
226
|
+
inputSchema?: Record<string, unknown>;
|
|
227
|
+
enabled: boolean;
|
|
228
|
+
metadata: Record<string, unknown>;
|
|
229
|
+
};
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/managers/tool.manager.d.ts
|
|
232
|
+
declare class ToolManager {
|
|
233
|
+
readonly listTools: () => never;
|
|
234
|
+
readonly getTool: (toolId: ToolId) => never;
|
|
235
|
+
readonly requireTool: (toolId: ToolId) => never;
|
|
236
|
+
readonly saveTool: (tool: ToolRecord) => never;
|
|
237
|
+
readonly enableTool: (toolId: ToolId) => never;
|
|
238
|
+
readonly disableTool: (toolId: ToolId) => never;
|
|
239
|
+
readonly resolveTools: (toolIds: ToolId[]) => never;
|
|
240
|
+
}
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region src/types/nextclaw-kernel.types.d.ts
|
|
243
|
+
type NextclawKernelRunMetadata = {
|
|
244
|
+
agentId?: AgentId;
|
|
245
|
+
model?: string;
|
|
246
|
+
skills?: SkillId[];
|
|
247
|
+
};
|
|
248
|
+
type NextclawKernelRunInput = {
|
|
249
|
+
sessionId: SessionId;
|
|
250
|
+
messages: NcpMessage[];
|
|
251
|
+
metadata?: NextclawKernelRunMetadata;
|
|
252
|
+
extra?: Record<string, unknown>;
|
|
253
|
+
};
|
|
254
|
+
type NextclawKernelRun = {
|
|
255
|
+
taskId: TaskId;
|
|
256
|
+
};
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/app/nextclaw-kernel.d.ts
|
|
259
|
+
type NextclawKernelRuntimeControl<TGatewayInput, TUiInput, TStartInput> = {
|
|
260
|
+
gateway: (input: TGatewayInput) => Promise<void>;
|
|
261
|
+
ui: (input: TUiInput) => Promise<void>;
|
|
262
|
+
start: (input: TStartInput) => Promise<void>;
|
|
263
|
+
restart: (input: TStartInput) => Promise<void>;
|
|
264
|
+
serve: (input: TStartInput) => Promise<void>;
|
|
265
|
+
stop: () => Promise<void>;
|
|
266
|
+
};
|
|
267
|
+
declare class NextclawKernelControlManager<TGatewayInput, TUiInput, TStartInput> {
|
|
268
|
+
private runtimeControl;
|
|
269
|
+
readonly installRuntimeControl: (runtimeControl: NextclawKernelRuntimeControl<TGatewayInput, TUiInput, TStartInput>) => void;
|
|
270
|
+
readonly requireRuntimeControl: () => NextclawKernelRuntimeControl<TGatewayInput, TUiInput, TStartInput>;
|
|
271
|
+
}
|
|
272
|
+
declare class NextclawKernel<TGatewayInput = unknown, TUiInput = unknown, TStartInput = unknown> {
|
|
273
|
+
readonly agents: AgentManager;
|
|
274
|
+
readonly tasks: TaskManager;
|
|
275
|
+
readonly sessions: SessionManager;
|
|
276
|
+
readonly contextBuilder: ContextBuilder;
|
|
277
|
+
readonly control: NextclawKernelControlManager<TGatewayInput, TUiInput, TStartInput>;
|
|
278
|
+
readonly tools: ToolManager;
|
|
279
|
+
readonly skills: SkillManager;
|
|
280
|
+
readonly llmProviders: LlmProviderManager;
|
|
281
|
+
readonly automation: AutomationManager;
|
|
282
|
+
readonly channels: ChannelManager;
|
|
283
|
+
readonly run: (input: NextclawKernelRunInput) => NextclawKernelRun;
|
|
284
|
+
}
|
|
285
|
+
//#endregion
|
|
286
|
+
export { AgentId, AgentManager, AgentRecord, AutomationId, AutomationManager, AutomationRecord, AutomationTrigger, ChannelDirection, ChannelId, ChannelManager, ChannelRecord, ContextBuilder, ContextRecord, LlmProviderId, LlmProviderManager, LlmProviderRecord, NextclawKernel, NextclawKernelRun, NextclawKernelRunInput, NextclawKernelRunMetadata, SessionId, SessionManager, SessionMessage, SessionRecord, SkillId, SkillManager, SkillRecord, TaskId, TaskManager, TaskRecord, TaskStatus, ToolId, ToolManager, ToolRecord };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
//#region src/managers/agent.manager.ts
|
|
2
|
+
var AgentManager = class {
|
|
3
|
+
listAgents = () => {
|
|
4
|
+
throw new Error("AgentManager.listAgents is not implemented.");
|
|
5
|
+
};
|
|
6
|
+
getAgent = (agentId) => {
|
|
7
|
+
throw new Error("AgentManager.getAgent is not implemented.");
|
|
8
|
+
};
|
|
9
|
+
requireAgent = (agentId) => {
|
|
10
|
+
throw new Error("AgentManager.requireAgent is not implemented.");
|
|
11
|
+
};
|
|
12
|
+
saveAgent = (agent) => {
|
|
13
|
+
throw new Error("AgentManager.saveAgent is not implemented.");
|
|
14
|
+
};
|
|
15
|
+
removeAgent = (agentId) => {
|
|
16
|
+
throw new Error("AgentManager.removeAgent is not implemented.");
|
|
17
|
+
};
|
|
18
|
+
attachSkill = (agentId, skillId) => {
|
|
19
|
+
throw new Error("AgentManager.attachSkill is not implemented.");
|
|
20
|
+
};
|
|
21
|
+
detachSkill = (agentId, skillId) => {
|
|
22
|
+
throw new Error("AgentManager.detachSkill is not implemented.");
|
|
23
|
+
};
|
|
24
|
+
attachTool = (agentId, toolId) => {
|
|
25
|
+
throw new Error("AgentManager.attachTool is not implemented.");
|
|
26
|
+
};
|
|
27
|
+
detachTool = (agentId, toolId) => {
|
|
28
|
+
throw new Error("AgentManager.detachTool is not implemented.");
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/managers/automation.manager.ts
|
|
33
|
+
var AutomationManager = class {
|
|
34
|
+
listAutomations = () => {
|
|
35
|
+
throw new Error("AutomationManager.listAutomations is not implemented.");
|
|
36
|
+
};
|
|
37
|
+
getAutomation = (automationId) => {
|
|
38
|
+
throw new Error("AutomationManager.getAutomation is not implemented.");
|
|
39
|
+
};
|
|
40
|
+
requireAutomation = (automationId) => {
|
|
41
|
+
throw new Error("AutomationManager.requireAutomation is not implemented.");
|
|
42
|
+
};
|
|
43
|
+
saveAutomation = (automation) => {
|
|
44
|
+
throw new Error("AutomationManager.saveAutomation is not implemented.");
|
|
45
|
+
};
|
|
46
|
+
enableAutomation = (automationId) => {
|
|
47
|
+
throw new Error("AutomationManager.enableAutomation is not implemented.");
|
|
48
|
+
};
|
|
49
|
+
disableAutomation = (automationId) => {
|
|
50
|
+
throw new Error("AutomationManager.disableAutomation is not implemented.");
|
|
51
|
+
};
|
|
52
|
+
deleteAutomation = (automationId) => {
|
|
53
|
+
throw new Error("AutomationManager.deleteAutomation is not implemented.");
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/managers/channel.manager.ts
|
|
58
|
+
var ChannelManager = class {
|
|
59
|
+
listChannels = () => {
|
|
60
|
+
throw new Error("ChannelManager.listChannels is not implemented.");
|
|
61
|
+
};
|
|
62
|
+
getChannel = (channelId) => {
|
|
63
|
+
throw new Error("ChannelManager.getChannel is not implemented.");
|
|
64
|
+
};
|
|
65
|
+
requireChannel = (channelId) => {
|
|
66
|
+
throw new Error("ChannelManager.requireChannel is not implemented.");
|
|
67
|
+
};
|
|
68
|
+
saveChannel = (channel) => {
|
|
69
|
+
throw new Error("ChannelManager.saveChannel is not implemented.");
|
|
70
|
+
};
|
|
71
|
+
enableChannel = (channelId) => {
|
|
72
|
+
throw new Error("ChannelManager.enableChannel is not implemented.");
|
|
73
|
+
};
|
|
74
|
+
disableChannel = (channelId) => {
|
|
75
|
+
throw new Error("ChannelManager.disableChannel is not implemented.");
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/managers/context-builder.manager.ts
|
|
80
|
+
var ContextBuilder = class {
|
|
81
|
+
constructor(sessions) {
|
|
82
|
+
this.sessions = sessions;
|
|
83
|
+
}
|
|
84
|
+
build = (input) => {
|
|
85
|
+
this.sessions;
|
|
86
|
+
throw new Error("ContextBuilder.build is not implemented.");
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/managers/llm-provider.manager.ts
|
|
91
|
+
var LlmProviderManager = class {
|
|
92
|
+
listProviders = () => {
|
|
93
|
+
throw new Error("LlmProviderManager.listProviders is not implemented.");
|
|
94
|
+
};
|
|
95
|
+
getProvider = (providerId) => {
|
|
96
|
+
throw new Error("LlmProviderManager.getProvider is not implemented.");
|
|
97
|
+
};
|
|
98
|
+
requireProvider = (providerId) => {
|
|
99
|
+
throw new Error("LlmProviderManager.requireProvider is not implemented.");
|
|
100
|
+
};
|
|
101
|
+
saveProvider = (provider) => {
|
|
102
|
+
throw new Error("LlmProviderManager.saveProvider is not implemented.");
|
|
103
|
+
};
|
|
104
|
+
enableProvider = (providerId) => {
|
|
105
|
+
throw new Error("LlmProviderManager.enableProvider is not implemented.");
|
|
106
|
+
};
|
|
107
|
+
disableProvider = (providerId) => {
|
|
108
|
+
throw new Error("LlmProviderManager.disableProvider is not implemented.");
|
|
109
|
+
};
|
|
110
|
+
selectProvider = (input) => {
|
|
111
|
+
throw new Error("LlmProviderManager.selectProvider is not implemented.");
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/managers/session.manager.ts
|
|
116
|
+
var SessionManager = class {
|
|
117
|
+
listSessions = () => {
|
|
118
|
+
throw new Error("SessionManager.listSessions is not implemented.");
|
|
119
|
+
};
|
|
120
|
+
getSession = (sessionId) => {
|
|
121
|
+
throw new Error("SessionManager.getSession is not implemented.");
|
|
122
|
+
};
|
|
123
|
+
requireSession = (sessionId) => {
|
|
124
|
+
throw new Error("SessionManager.requireSession is not implemented.");
|
|
125
|
+
};
|
|
126
|
+
createSession = (input) => {
|
|
127
|
+
throw new Error("SessionManager.createSession is not implemented.");
|
|
128
|
+
};
|
|
129
|
+
saveSession = (session) => {
|
|
130
|
+
throw new Error("SessionManager.saveSession is not implemented.");
|
|
131
|
+
};
|
|
132
|
+
appendMessage = (sessionId, message) => {
|
|
133
|
+
throw new Error("SessionManager.appendMessage is not implemented.");
|
|
134
|
+
};
|
|
135
|
+
attachTask = (sessionId, taskId) => {
|
|
136
|
+
throw new Error("SessionManager.attachTask is not implemented.");
|
|
137
|
+
};
|
|
138
|
+
closeSession = (sessionId) => {
|
|
139
|
+
throw new Error("SessionManager.closeSession is not implemented.");
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region src/managers/skill.manager.ts
|
|
144
|
+
var SkillManager = class {
|
|
145
|
+
listSkills = () => {
|
|
146
|
+
throw new Error("SkillManager.listSkills is not implemented.");
|
|
147
|
+
};
|
|
148
|
+
getSkill = (skillId) => {
|
|
149
|
+
throw new Error("SkillManager.getSkill is not implemented.");
|
|
150
|
+
};
|
|
151
|
+
requireSkill = (skillId) => {
|
|
152
|
+
throw new Error("SkillManager.requireSkill is not implemented.");
|
|
153
|
+
};
|
|
154
|
+
saveSkill = (skill) => {
|
|
155
|
+
throw new Error("SkillManager.saveSkill is not implemented.");
|
|
156
|
+
};
|
|
157
|
+
enableSkill = (skillId) => {
|
|
158
|
+
throw new Error("SkillManager.enableSkill is not implemented.");
|
|
159
|
+
};
|
|
160
|
+
disableSkill = (skillId) => {
|
|
161
|
+
throw new Error("SkillManager.disableSkill is not implemented.");
|
|
162
|
+
};
|
|
163
|
+
resolveSkills = (skillIds) => {
|
|
164
|
+
throw new Error("SkillManager.resolveSkills is not implemented.");
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/managers/task.manager.ts
|
|
169
|
+
var TaskManager = class {
|
|
170
|
+
listTasks = () => {
|
|
171
|
+
throw new Error("TaskManager.listTasks is not implemented.");
|
|
172
|
+
};
|
|
173
|
+
getTask = (taskId) => {
|
|
174
|
+
throw new Error("TaskManager.getTask is not implemented.");
|
|
175
|
+
};
|
|
176
|
+
requireTask = (taskId) => {
|
|
177
|
+
throw new Error("TaskManager.requireTask is not implemented.");
|
|
178
|
+
};
|
|
179
|
+
createTask = (input) => {
|
|
180
|
+
throw new Error("TaskManager.createTask is not implemented.");
|
|
181
|
+
};
|
|
182
|
+
saveTask = (task) => {
|
|
183
|
+
throw new Error("TaskManager.saveTask is not implemented.");
|
|
184
|
+
};
|
|
185
|
+
updateTaskStatus = (taskId, status) => {
|
|
186
|
+
throw new Error("TaskManager.updateTaskStatus is not implemented.");
|
|
187
|
+
};
|
|
188
|
+
completeTask = (taskId, output) => {
|
|
189
|
+
throw new Error("TaskManager.completeTask is not implemented.");
|
|
190
|
+
};
|
|
191
|
+
failTask = (taskId, error) => {
|
|
192
|
+
throw new Error("TaskManager.failTask is not implemented.");
|
|
193
|
+
};
|
|
194
|
+
cancelTask = (taskId) => {
|
|
195
|
+
throw new Error("TaskManager.cancelTask is not implemented.");
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/managers/tool.manager.ts
|
|
200
|
+
var ToolManager = class {
|
|
201
|
+
listTools = () => {
|
|
202
|
+
throw new Error("ToolManager.listTools is not implemented.");
|
|
203
|
+
};
|
|
204
|
+
getTool = (toolId) => {
|
|
205
|
+
throw new Error("ToolManager.getTool is not implemented.");
|
|
206
|
+
};
|
|
207
|
+
requireTool = (toolId) => {
|
|
208
|
+
throw new Error("ToolManager.requireTool is not implemented.");
|
|
209
|
+
};
|
|
210
|
+
saveTool = (tool) => {
|
|
211
|
+
throw new Error("ToolManager.saveTool is not implemented.");
|
|
212
|
+
};
|
|
213
|
+
enableTool = (toolId) => {
|
|
214
|
+
throw new Error("ToolManager.enableTool is not implemented.");
|
|
215
|
+
};
|
|
216
|
+
disableTool = (toolId) => {
|
|
217
|
+
throw new Error("ToolManager.disableTool is not implemented.");
|
|
218
|
+
};
|
|
219
|
+
resolveTools = (toolIds) => {
|
|
220
|
+
throw new Error("ToolManager.resolveTools is not implemented.");
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/app/nextclaw-kernel.ts
|
|
225
|
+
var NextclawKernelControlManager = class {
|
|
226
|
+
runtimeControl = null;
|
|
227
|
+
installRuntimeControl = (runtimeControl) => {
|
|
228
|
+
this.runtimeControl = runtimeControl;
|
|
229
|
+
};
|
|
230
|
+
requireRuntimeControl = () => {
|
|
231
|
+
if (!this.runtimeControl) throw new Error("Kernel runtime control is not installed.");
|
|
232
|
+
return this.runtimeControl;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
var NextclawKernel = class {
|
|
236
|
+
agents = new AgentManager();
|
|
237
|
+
tasks = new TaskManager();
|
|
238
|
+
sessions = new SessionManager();
|
|
239
|
+
contextBuilder = new ContextBuilder(this.sessions);
|
|
240
|
+
control = new NextclawKernelControlManager();
|
|
241
|
+
tools = new ToolManager();
|
|
242
|
+
skills = new SkillManager();
|
|
243
|
+
llmProviders = new LlmProviderManager();
|
|
244
|
+
automation = new AutomationManager();
|
|
245
|
+
channels = new ChannelManager();
|
|
246
|
+
run = (input) => {
|
|
247
|
+
throw new Error("NextclawKernel.run is not implemented.");
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
//#endregion
|
|
251
|
+
export { AgentManager, AutomationManager, ChannelManager, ContextBuilder, LlmProviderManager, NextclawKernel, SessionManager, SkillManager, TaskManager, ToolManager };
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nextclaw/kernel",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "NextClaw product kernel skeleton for agents, tasks, sessions, context, tools, skills, providers, automation, and channels.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"development": "./src/index.ts",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@nextclaw/ncp": "0.5.5"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "^20.17.6",
|
|
22
|
+
"prettier": "^3.3.3",
|
|
23
|
+
"typescript": "^5.6.3"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsdown src/index.ts --dts --clean --target es2022 --no-fixedExtension",
|
|
27
|
+
"lint": "eslint .",
|
|
28
|
+
"tsc": "tsc -p tsconfig.json"
|
|
29
|
+
}
|
|
30
|
+
}
|