@kernel.chat/kbot 3.99.34 → 4.0.0
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/README.md +9 -6
- package/dist/agent-protocol.js +5 -0
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +20 -2
- package/dist/cli.js +6 -6
- package/dist/plugin-sdk.d.ts +23 -2
- package/dist/plugin-sdk.js +118 -8
- package/dist/plugins.js +15 -1
- package/dist/providers/llada.d.ts +98 -0
- package/dist/providers/llada.js +197 -0
- package/dist/tools/browser.js +1 -0
- package/dist/tools/computer.js +6 -0
- package/dist/tools/containers.js +1 -0
- package/dist/tools/creative.js +5 -0
- package/dist/tools/deploy.js +1 -0
- package/dist/tools/emergent.js +1 -0
- package/dist/tools/gamedev.js +16 -0
- package/dist/tools/hacker-toolkit.js +6 -0
- package/dist/tools/image-thoughtful.d.ts +2 -2
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +16 -80
- package/dist/tools/kbot-browser.js +1 -0
- package/dist/tools/llada-image.d.ts +38 -0
- package/dist/tools/llada-image.js +171 -0
- package/dist/tools/quality.js +1 -0
- package/dist/tools/redblue.js +4 -0
- package/dist/tools/security-brain.js +3 -0
- package/dist/tools/security-hunt.js +1 -0
- package/dist/tools/security.js +6 -0
- package/dist/tools/swarm-2026-04.js +2 -0
- package/dist/tools/test-runner.js +1 -0
- package/dist/tools/threat-intel.js +2 -0
- package/dist/ui.js +2 -2
- package/package.json +2 -2
package/dist/tools/index.js
CHANGED
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
// Re-export the middleware pipeline system
|
|
13
13
|
export { ToolPipeline, createDefaultPipeline, permissionMiddleware, hookMiddleware, timeoutMiddleware, metricsMiddleware, truncationMiddleware, telemetryMiddleware, executionMiddleware, fallbackMiddleware, mcpAppsMiddleware, DEFAULT_FALLBACK_RULES, } from '../tool-pipeline.js';
|
|
14
14
|
import { ToolPipeline, executionMiddleware } from '../tool-pipeline.js';
|
|
15
|
+
import chalk from 'chalk';
|
|
16
|
+
/** Tools whose deprecation warning has already been emitted this process. */
|
|
17
|
+
const deprecationWarned = new Set();
|
|
15
18
|
const registry = new Map();
|
|
16
19
|
const metrics = new Map();
|
|
17
20
|
const DEFAULT_TIMEOUT = 300_000; // 5 minutes
|
|
@@ -118,6 +121,19 @@ export async function executeTool(call) {
|
|
|
118
121
|
`If no MCP server exists, consider using forge_tool to create it at runtime.`;
|
|
119
122
|
return { tool_call_id: call.id, result: suggestion, error: true, duration_ms: 0 };
|
|
120
123
|
}
|
|
124
|
+
// Deprecation warn-once: emit a single chalk.yellow message per tool name per process.
|
|
125
|
+
if (tool.deprecated && !deprecationWarned.has(call.name)) {
|
|
126
|
+
deprecationWarned.add(call.name);
|
|
127
|
+
try {
|
|
128
|
+
console.warn(chalk.yellow(`[kbot] Tool '${call.name}' is deprecated as of v4.0 and scheduled for removal in 4.1.0. ` +
|
|
129
|
+
`See https://github.com/isaacsight/kernel/blob/main/packages/kbot/RELEASE_NOTES_4_0.md`));
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
// chalk may not be available in some test contexts — fall back to plain text.
|
|
133
|
+
console.warn(`[kbot] Tool '${call.name}' is deprecated as of v4.0 and scheduled for removal in 4.1.0. ` +
|
|
134
|
+
`See https://github.com/isaacsight/kernel/blob/main/packages/kbot/RELEASE_NOTES_4_0.md`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
121
137
|
const timeout = tool.timeout ?? DEFAULT_TIMEOUT;
|
|
122
138
|
const maxResult = tool.maxResultSize ?? DEFAULT_MAX_RESULT;
|
|
123
139
|
const startTime = Date.now();
|
|
@@ -207,76 +223,35 @@ const LAZY_MODULE_IMPORTS = [
|
|
|
207
223
|
{ path: './parallel.js', registerFn: 'registerParallelTools' },
|
|
208
224
|
{ path: './mcp-client.js', registerFn: 'registerMcpClientTools' },
|
|
209
225
|
{ path: './tasks.js', registerFn: 'registerTaskTools' },
|
|
210
|
-
{ path: './notebook.js', registerFn: 'registerNotebookTools' },
|
|
211
226
|
{ path: './background.js', registerFn: 'registerBackgroundTools' },
|
|
212
227
|
{ path: './sandbox.js', registerFn: 'registerSandboxTools' },
|
|
213
|
-
{ path: './build-matrix.js', registerFn: 'registerBuildMatrixTools' },
|
|
214
228
|
{ path: './subagent.js', registerFn: 'registerSubagentTools' },
|
|
215
229
|
{ path: './worktree.js', registerFn: 'registerWorktreeTools' },
|
|
216
|
-
{ path: './kbot-local.js', registerFn: 'registerKbotLocalTools' },
|
|
217
230
|
{ path: './quality.js', registerFn: 'registerQualityTools' },
|
|
218
231
|
{ path: './memory-tools.js', registerFn: 'registerMemoryTools' },
|
|
219
232
|
{ path: './browser.js', registerFn: 'registerBrowserTools' },
|
|
220
|
-
{ path: './e2b-sandbox.js', registerFn: 'registerE2bTools' },
|
|
221
|
-
{ path: './lsp-tools.js', registerFn: 'registerLspTools' },
|
|
222
|
-
{ path: '../mcp-plugins.js', registerFn: 'registerMcpPluginTools' },
|
|
223
|
-
{ path: '../graph-memory.js', registerFn: 'registerGraphMemoryTools' },
|
|
224
|
-
{ path: '../confidence.js', registerFn: 'registerConfidenceTools' },
|
|
225
233
|
{ path: '../agent-protocol.js', registerFn: 'registerAgentProtocolTools' },
|
|
226
234
|
{ path: '../temporal.js', registerFn: 'registerTemporalTools' },
|
|
227
|
-
{ path: '../reasoning.js', registerFn: 'registerReasoningTools' },
|
|
228
235
|
{ path: '../intentionality.js', registerFn: 'registerIntentionalityTools' },
|
|
229
236
|
{ path: './test-runner.js', registerFn: 'registerTestRunnerTools' },
|
|
230
237
|
{ path: './creative.js', registerFn: 'registerCreativeTools' },
|
|
231
|
-
{ path: './comfyui-plugin.js', registerFn: 'registerComfyUITools' },
|
|
232
238
|
{ path: './magenta-plugin.js', registerFn: 'registerMagentaTools' },
|
|
233
|
-
{ path: './research.js', registerFn: 'registerResearchTools' },
|
|
234
239
|
{ path: './containers.js', registerFn: 'registerContainerTools' },
|
|
235
240
|
{ path: './vfx.js', registerFn: 'registerVfxTools' },
|
|
236
241
|
{ path: './gamedev.js', registerFn: 'registerGamedevTools' },
|
|
237
242
|
{ path: './audit.js', registerFn: 'registerAuditTools' },
|
|
238
|
-
{ path: './documents.js', registerFn: 'registerDocumentTools' },
|
|
239
|
-
{ path: './contribute.js', registerFn: 'registerContributeTools' },
|
|
240
|
-
{ path: './composio.js', registerFn: 'registerComposioTools' },
|
|
241
|
-
{ path: '../marketplace.js', registerFn: 'registerMarketplaceTools' },
|
|
242
243
|
{ path: './browser-agent.js', registerFn: 'registerBrowserAgentTools' },
|
|
243
|
-
{ path: '../workflows.js', registerFn: 'registerWorkflowTools' },
|
|
244
244
|
{ path: './deploy.js', registerFn: 'registerDeployTools' },
|
|
245
245
|
{ path: './mcp-marketplace.js', registerFn: 'registerMcpMarketplaceTools' },
|
|
246
246
|
{ path: './database.js', registerFn: 'registerDatabaseTools' },
|
|
247
|
-
{ path: '../team.js', registerFn: 'registerTeamTools' },
|
|
248
247
|
{ path: '../plugin-sdk.js', registerFn: 'registerPluginSDKTools' },
|
|
249
|
-
{ path: './training.js', registerFn: 'registerTrainingTools' },
|
|
250
248
|
{ path: './social.js', registerFn: 'registerSocialTools' },
|
|
251
249
|
{ path: './forge.js', registerFn: 'registerForgeTools' },
|
|
252
|
-
{ path: '../mcp-apps.js', registerFn: 'registerMcpAppTools' },
|
|
253
|
-
{ path: './machine-tools.js', registerFn: 'registerMachineTools' },
|
|
254
|
-
{ path: './finance.js', registerFn: 'registerFinanceTools' },
|
|
255
|
-
{ path: './wallet.js', registerFn: 'registerWalletTools' },
|
|
256
|
-
{ path: './stocks.js', registerFn: 'registerStockTools' },
|
|
257
|
-
{ path: './sentiment.js', registerFn: 'registerSentimentTools' },
|
|
258
250
|
{ path: './security.js', registerFn: 'registerSecurityTools' },
|
|
259
251
|
{ path: './email.js', registerFn: 'registerEmailTools' },
|
|
260
|
-
{ path: './content-engine.js', registerFn: 'registerContentEngineTools' },
|
|
261
|
-
{ path: './bootstrapper.js', registerFn: 'registerBootstrapperTools' },
|
|
262
|
-
{ path: './lab-core.js', registerFn: 'registerLabCoreTools' },
|
|
263
|
-
{ path: './lab-data.js', registerFn: 'registerLabDataTools' },
|
|
264
|
-
{ path: './lab-bio.js', registerFn: 'registerLabBioTools' },
|
|
265
|
-
{ path: './lab-chem.js', registerFn: 'registerLabChemTools' },
|
|
266
|
-
{ path: './lab-physics.js', registerFn: 'registerLabPhysicsTools' },
|
|
267
|
-
{ path: './lab-earth.js', registerFn: 'registerLabEarthTools' },
|
|
268
|
-
{ path: './lab-math.js', registerFn: 'registerLabMathTools' },
|
|
269
|
-
{ path: './lab-neuro.js', registerFn: 'registerLabNeuroTools' },
|
|
270
|
-
{ path: './lab-social.js', registerFn: 'registerLabSocialTools' },
|
|
271
|
-
{ path: './lab-humanities.js', registerFn: 'registerLabHumanitiesTools' },
|
|
272
|
-
{ path: './lab-health.js', registerFn: 'registerLabHealthTools' },
|
|
273
|
-
{ path: './science-graph.js', registerFn: 'registerScienceGraphTools' },
|
|
274
|
-
{ path: './research-pipeline.js', registerFn: 'registerResearchPipelineTools' },
|
|
275
|
-
{ path: './research-notebook.js', registerFn: 'registerResearchNotebookTools' },
|
|
276
252
|
{ path: './hypothesis-engine.js', registerFn: 'registerHypothesisEngineTools' },
|
|
277
253
|
{ path: './emergent.js', registerFn: 'registerEmergentTools' },
|
|
278
254
|
{ path: './security-hunt.js', registerFn: 'registerSecurityHuntTools' },
|
|
279
|
-
{ path: './lab-frontier.js', registerFn: 'registerFrontierTools' },
|
|
280
255
|
{ path: './ableton.js', registerFn: 'registerAbletonTools' },
|
|
281
256
|
{ path: './ableton-knowledge.js', registerFn: 'registerAbletonKnowledgeTools' },
|
|
282
257
|
{ path: './ableton-bridge-tools.js', registerFn: 'registerAbletonBridgeTools' },
|
|
@@ -285,59 +260,20 @@ const LAZY_MODULE_IMPORTS = [
|
|
|
285
260
|
{ path: './producer-engine.js', registerFn: 'registerProducerEngine' },
|
|
286
261
|
{ path: './sound-designer.js', registerFn: 'registerSoundDesignerTools' },
|
|
287
262
|
{ path: './arrangement-engine.js', registerFn: 'registerArrangementEngine' },
|
|
288
|
-
{ path: '../behaviour.js', registerFn: 'registerBehaviourTools' },
|
|
289
263
|
{ path: '../skill-system.js', registerFn: 'registerSkillTools' },
|
|
290
|
-
{ path: './admin.js', registerFn: 'registerAdminTools' },
|
|
291
|
-
{ path: './monitor.js', registerFn: 'registerMonitorTools' },
|
|
292
|
-
{ path: './deploy-all.js', registerFn: 'registerDeployAllTools' },
|
|
293
264
|
{ path: './analytics.js', registerFn: 'registerAnalyticsTools' },
|
|
294
|
-
{ path: './env-manager.js', registerFn: 'registerEnvTools' },
|
|
295
|
-
{ path: './db-admin.js', registerFn: 'registerDbAdminTools' },
|
|
296
|
-
{ path: './visa-payments.js', registerFn: 'registerVisaPaymentTools' },
|
|
297
265
|
{ path: './security-brain.js', registerFn: 'registerSecurityBrainTools' },
|
|
298
|
-
{ path: './ctf.js', registerFn: 'registerCtfTools' },
|
|
299
|
-
{ path: './pentest.js', registerFn: 'registerPentestTools' },
|
|
300
266
|
{ path: './redblue.js', registerFn: 'registerRedBlueTools' },
|
|
301
267
|
{ path: './hacker-toolkit.js', registerFn: 'registerHackerToolkitTools' },
|
|
302
268
|
{ path: './threat-intel.js', registerFn: 'registerThreatIntelTools' },
|
|
303
269
|
{ path: './dj-set-builder.js', registerFn: 'registerDjSetBuilderTools' },
|
|
304
270
|
{ path: './serum2-preset.js', registerFn: 'registerSerum2PresetTools' },
|
|
305
271
|
{ path: './dream-tools.js', registerFn: 'registerDreamTools' },
|
|
306
|
-
{ path: './collective-dream-tools.js', registerFn: 'registerCollectiveDreamTools' },
|
|
307
|
-
{ path: './memory-scanner-tools.js', registerFn: 'registerMemoryScannerTools' },
|
|
308
|
-
{ path: './buddy-tools.js', registerFn: 'registerBuddyTools' },
|
|
309
|
-
{ path: './voice-input-tools.js', registerFn: 'registerVoiceInputTools' },
|
|
310
|
-
{ path: './watchdog.js', registerFn: 'registerWatchdogTools' },
|
|
311
|
-
{ path: './behavior-tools.js', registerFn: 'registerBehaviorTools' },
|
|
312
|
-
{ path: './a2a.js', registerFn: 'registerA2ATools' },
|
|
313
|
-
{ path: './financial-analysis.js', registerFn: 'registerFinancialAnalysisTools' },
|
|
314
|
-
{ path: './ai-analysis.js', registerFn: 'registerAIAnalysisTools' },
|
|
315
|
-
{ path: './music-gen.js', registerFn: 'registerMusicGenTools' },
|
|
316
272
|
{ path: './one-prompt-producer.js', registerFn: 'registerOnePromptTools' },
|
|
317
|
-
{ path: './mobile-automation.js', registerFn: 'registerMobileAutomationTools' },
|
|
318
|
-
{ path: './iphone.js', registerFn: 'registerIPhoneTools' },
|
|
319
|
-
{ path: './ghost.js', registerFn: 'registerGhostTools' },
|
|
320
|
-
{ path: './streaming.js', registerFn: 'registerStreamingTools' },
|
|
321
|
-
{ path: './stream-character.js', registerFn: 'registerStreamCharacterTools' },
|
|
322
|
-
{ path: './stream-renderer.js', registerFn: 'registerStreamRendererTools' },
|
|
323
273
|
{ path: './kbot-browser.js', registerFn: 'registerKBotBrowserTools' },
|
|
324
274
|
{ path: './kbot-terminal.js', registerFn: 'registerKBotTerminalTools' },
|
|
325
|
-
{ path: './stream-control.js', registerFn: 'registerStreamControlTools' },
|
|
326
|
-
{ path: './tile-world.js', registerFn: 'registerTileWorldTools' },
|
|
327
|
-
{ path: './stream-self-eval.js', registerFn: 'registerStreamSelfEvalTools' },
|
|
328
275
|
{ path: './audio-engine.js', registerFn: 'registerAudioEngineTools' },
|
|
329
|
-
{ path: './narrative-engine.js', registerFn: 'registerNarrativeEngineTools' },
|
|
330
|
-
{ path: './social-engine.js', registerFn: 'registerSocialEngineTools' },
|
|
331
|
-
{ path: './evolution-engine.js', registerFn: 'registerEvolutionEngineTools' },
|
|
332
|
-
{ path: './coordination-engine.js', registerFn: 'registerCoordinationEngineTools' },
|
|
333
276
|
{ path: './foundation-engines.js', registerFn: 'registerFoundationEngineTools' },
|
|
334
|
-
{ path: './research-engine.js', registerFn: 'registerResearchEngineTools' },
|
|
335
|
-
{ path: './stream-overlay.js', registerFn: 'registerOverlayTools' },
|
|
336
|
-
{ path: './stream-weather.js', registerFn: 'registerStreamWeatherTools' },
|
|
337
|
-
{ path: './stream-chat-ai.js', registerFn: 'registerStreamChatAITools' },
|
|
338
|
-
{ path: './stream-vod.js', registerFn: 'registerStreamVODTools' },
|
|
339
|
-
{ path: './stream-commands.js', registerFn: 'registerStreamCommandsTools' },
|
|
340
|
-
{ path: '../coordinator.js', registerFn: 'registerCoordinatorTools' },
|
|
341
277
|
{ path: './swarm-2026-04.js', registerFn: 'registerSwarm2026Tools' },
|
|
342
278
|
];
|
|
343
279
|
/** Track whether lazy tools have been registered */
|
|
@@ -939,6 +939,7 @@ export function registerKBotBrowserTools() {
|
|
|
939
939
|
});
|
|
940
940
|
registerTool({
|
|
941
941
|
name: 'kbot_read',
|
|
942
|
+
deprecated: true,
|
|
942
943
|
description: "Get the current page content in reader mode (clean text, no clutter). Uses kbot's built-in browser.",
|
|
943
944
|
parameters: {},
|
|
944
945
|
tier: 'free',
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolDefinition } from './index.js';
|
|
3
|
+
import { LLaDAClient } from '../providers/llada.js';
|
|
4
|
+
export declare const lladaImageInputSchema: z.ZodObject<{
|
|
5
|
+
prompt: z.ZodString;
|
|
6
|
+
aspect_ratio: z.ZodDefault<z.ZodOptional<z.ZodEnum<["1:1", "16:9", "9:16", "4:3", "3:4"]>>>;
|
|
7
|
+
thinking_steps: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
8
|
+
style_hints: z.ZodOptional<z.ZodString>;
|
|
9
|
+
reference_image_url: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
prompt: string;
|
|
12
|
+
thinking_steps: number;
|
|
13
|
+
aspect_ratio: "1:1" | "16:9" | "9:16" | "4:3" | "3:4";
|
|
14
|
+
style_hints?: string | undefined;
|
|
15
|
+
reference_image_url?: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
prompt: string;
|
|
18
|
+
thinking_steps?: number | undefined;
|
|
19
|
+
aspect_ratio?: "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | undefined;
|
|
20
|
+
style_hints?: string | undefined;
|
|
21
|
+
reference_image_url?: string | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export type LLaDAImageInput = z.infer<typeof lladaImageInputSchema>;
|
|
24
|
+
export interface LLaDAImageThoughtfulOutput {
|
|
25
|
+
url: string;
|
|
26
|
+
plan: string;
|
|
27
|
+
refinements: string[];
|
|
28
|
+
final_prompt: string;
|
|
29
|
+
/** Optional reasoning trace surfaced by LLaDA's `thinking` mode. */
|
|
30
|
+
thinking?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface RunLLaDAImageOptions {
|
|
33
|
+
/** Inject a client (for tests). Defaults to a fresh LLaDAClient(). */
|
|
34
|
+
client?: LLaDAClient;
|
|
35
|
+
}
|
|
36
|
+
export declare function runLLaDAImageThoughtful(rawInput: unknown, opts?: RunLLaDAImageOptions): Promise<LLaDAImageThoughtfulOutput>;
|
|
37
|
+
export declare const lladaImageTool: ToolDefinition;
|
|
38
|
+
//# sourceMappingURL=llada-image.d.ts.map
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// kbot Local Image Thoughtful Tool — LLaDA2.0-Uni route
|
|
2
|
+
//
|
|
3
|
+
// Mirrors `image-thoughtful.ts` (which uses OpenAI gpt-image-2) but routes
|
|
4
|
+
// every call — plan, refine, generate — through a local LLaDA2.0-Uni server.
|
|
5
|
+
// LLaDA is a *unified* discrete-diffusion model: the same model that does
|
|
6
|
+
// chat reasoning also does the final image generation, so this tool is the
|
|
7
|
+
// $0 / no-API-key path to thoughtful image gen.
|
|
8
|
+
//
|
|
9
|
+
// SPEC: refine when LLaDA's API stabilizes — currently assumes OpenAI-compatible
|
|
10
|
+
// shape on http://localhost:8000. See `src/providers/llada.ts` for details.
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
import { LLaDAClient } from '../providers/llada.js';
|
|
13
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
14
|
+
// Schema (kept in lockstep with image-thoughtful.ts)
|
|
15
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
16
|
+
const AspectRatio = z.enum(['1:1', '16:9', '9:16', '4:3', '3:4']);
|
|
17
|
+
export const lladaImageInputSchema = z.object({
|
|
18
|
+
prompt: z.string().min(1, 'prompt is required'),
|
|
19
|
+
aspect_ratio: AspectRatio.optional().default('1:1'),
|
|
20
|
+
thinking_steps: z.number().int().min(1).max(5).optional().default(3),
|
|
21
|
+
style_hints: z.string().optional(),
|
|
22
|
+
reference_image_url: z.string().url().optional(),
|
|
23
|
+
});
|
|
24
|
+
// LLaDA's image_h/image_w map cleanly off these aspect-ratio sizes.
|
|
25
|
+
const SIZE_MAP = {
|
|
26
|
+
'1:1': '1024x1024',
|
|
27
|
+
'16:9': '1792x1024',
|
|
28
|
+
'9:16': '1024x1792',
|
|
29
|
+
'4:3': '1408x1056',
|
|
30
|
+
'3:4': '1056x1408',
|
|
31
|
+
};
|
|
32
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
33
|
+
// Prompts (intentionally identical wording to image-thoughtful for parity)
|
|
34
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
35
|
+
function planSystemPrompt() {
|
|
36
|
+
return [
|
|
37
|
+
'You are an expert art director planning an image before generation.',
|
|
38
|
+
'Return a JSON object with keys: composition, palette, key_elements, mood, lighting, style.',
|
|
39
|
+
'Keep each value to one or two sentences. Be concrete and visual.',
|
|
40
|
+
].join(' ');
|
|
41
|
+
}
|
|
42
|
+
function critiqueSystemPrompt() {
|
|
43
|
+
return [
|
|
44
|
+
'You are a critic refining an image plan. Read the prompt and the current plan,',
|
|
45
|
+
'identify the single weakest element, and return an improved JSON plan with the',
|
|
46
|
+
'same keys (composition, palette, key_elements, mood, lighting, style).',
|
|
47
|
+
'Do not restate the brief — produce the next iteration of the plan only.',
|
|
48
|
+
].join(' ');
|
|
49
|
+
}
|
|
50
|
+
function finalPromptSystemPrompt() {
|
|
51
|
+
return [
|
|
52
|
+
'You compose the final image-generation prompt. Combine the brief, plan, and any',
|
|
53
|
+
'style hints into a single cohesive paragraph (no JSON, no headings, no lists).',
|
|
54
|
+
'Lead with subject and composition, then palette, lighting, mood, and style.',
|
|
55
|
+
].join(' ');
|
|
56
|
+
}
|
|
57
|
+
function buildPlanUserText(input) {
|
|
58
|
+
return [
|
|
59
|
+
`Brief: ${input.prompt}`,
|
|
60
|
+
`Aspect ratio: ${input.aspect_ratio}`,
|
|
61
|
+
input.style_hints ? `Style hints: ${input.style_hints}` : null,
|
|
62
|
+
input.reference_image_url ? `Reference image URL: ${input.reference_image_url}` : null,
|
|
63
|
+
]
|
|
64
|
+
.filter(Boolean)
|
|
65
|
+
.join('\n');
|
|
66
|
+
}
|
|
67
|
+
export async function runLLaDAImageThoughtful(rawInput, opts = {}) {
|
|
68
|
+
const input = lladaImageInputSchema.parse(rawInput);
|
|
69
|
+
const client = opts.client ?? new LLaDAClient();
|
|
70
|
+
// 1. Plan
|
|
71
|
+
const planResp = await client.chat({
|
|
72
|
+
messages: [
|
|
73
|
+
{ role: 'system', content: planSystemPrompt() },
|
|
74
|
+
{ role: 'user', content: buildPlanUserText(input) },
|
|
75
|
+
],
|
|
76
|
+
temperature: 0.5,
|
|
77
|
+
});
|
|
78
|
+
const plan = planResp.text;
|
|
79
|
+
// 2. Refine — thinking_steps - 1 critique passes (1 = no refinement)
|
|
80
|
+
const refinements = [];
|
|
81
|
+
let currentPlan = plan;
|
|
82
|
+
for (let i = 1; i < input.thinking_steps; i++) {
|
|
83
|
+
const next = await client.chat({
|
|
84
|
+
messages: [
|
|
85
|
+
{ role: 'system', content: critiqueSystemPrompt() },
|
|
86
|
+
{
|
|
87
|
+
role: 'user',
|
|
88
|
+
content: `Brief: ${input.prompt}\nCurrent plan: ${currentPlan}`,
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
temperature: 0.5,
|
|
92
|
+
});
|
|
93
|
+
refinements.push(next.text);
|
|
94
|
+
currentPlan = next.text;
|
|
95
|
+
}
|
|
96
|
+
// 3. Compose final prompt
|
|
97
|
+
const finalResp = await client.chat({
|
|
98
|
+
messages: [
|
|
99
|
+
{ role: 'system', content: finalPromptSystemPrompt() },
|
|
100
|
+
{
|
|
101
|
+
role: 'user',
|
|
102
|
+
content: [
|
|
103
|
+
`Brief: ${input.prompt}`,
|
|
104
|
+
input.style_hints ? `Style hints: ${input.style_hints}` : '',
|
|
105
|
+
`Plan: ${currentPlan}`,
|
|
106
|
+
]
|
|
107
|
+
.filter(Boolean)
|
|
108
|
+
.join('\n\n'),
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
temperature: 0.4,
|
|
112
|
+
});
|
|
113
|
+
const finalPromptText = finalResp.text;
|
|
114
|
+
// 4. Generate (LLaDA-native call — same model, diffusion decoder).
|
|
115
|
+
const img = await client.generateImage({
|
|
116
|
+
prompt: finalPromptText,
|
|
117
|
+
size: SIZE_MAP[input.aspect_ratio],
|
|
118
|
+
refImage: input.reference_image_url,
|
|
119
|
+
});
|
|
120
|
+
return {
|
|
121
|
+
url: img.url,
|
|
122
|
+
plan,
|
|
123
|
+
refinements,
|
|
124
|
+
final_prompt: finalPromptText,
|
|
125
|
+
thinking: img.thinking,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
129
|
+
// Tool definition
|
|
130
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
131
|
+
export const lladaImageTool = {
|
|
132
|
+
name: 'local_image_thoughtful',
|
|
133
|
+
description: 'Local plan/refine/generate image tool routed through a LLaDA2.0-Uni server (default http://localhost:8000). The same unified diffusion LLM does both the planning and the final image generation, so no OpenAI key is required. Returns the image URL plus the full reasoning trail.',
|
|
134
|
+
tier: 'free',
|
|
135
|
+
parameters: {
|
|
136
|
+
prompt: {
|
|
137
|
+
type: 'string',
|
|
138
|
+
description: 'What to draw — the brief.',
|
|
139
|
+
required: true,
|
|
140
|
+
},
|
|
141
|
+
aspect_ratio: {
|
|
142
|
+
type: 'string',
|
|
143
|
+
description: 'One of "1:1", "16:9", "9:16", "4:3", "3:4". Default "1:1".',
|
|
144
|
+
default: '1:1',
|
|
145
|
+
},
|
|
146
|
+
thinking_steps: {
|
|
147
|
+
type: 'number',
|
|
148
|
+
description: 'How many plan iterations to run (1..5). Default 3. 1 skips refinement.',
|
|
149
|
+
default: 3,
|
|
150
|
+
},
|
|
151
|
+
style_hints: {
|
|
152
|
+
type: 'string',
|
|
153
|
+
description: 'Optional style guidance ("oil painting", "ukiyo-e", "isometric vector").',
|
|
154
|
+
},
|
|
155
|
+
reference_image_url: {
|
|
156
|
+
type: 'string',
|
|
157
|
+
description: 'Optional URL of a reference image. Forwarded to LLaDA as the editing source (input_image).',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
async execute(args) {
|
|
161
|
+
try {
|
|
162
|
+
const out = await runLLaDAImageThoughtful(args);
|
|
163
|
+
return JSON.stringify(out, null, 2);
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
167
|
+
return `Error: ${message}`;
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
//# sourceMappingURL=llada-image.js.map
|
package/dist/tools/quality.js
CHANGED
|
@@ -182,6 +182,7 @@ export function registerQualityTools() {
|
|
|
182
182
|
// ── Dependency Audit ──
|
|
183
183
|
registerTool({
|
|
184
184
|
name: 'deps_audit',
|
|
185
|
+
deprecated: true,
|
|
185
186
|
description: 'Audit dependencies for known vulnerabilities. Returns CVE IDs, severity, and fix suggestions. Auto-detects npm, pip, cargo, go.',
|
|
186
187
|
parameters: {
|
|
187
188
|
fix: { type: 'boolean', description: 'Auto-fix vulnerabilities where possible (default: false)' },
|
package/dist/tools/redblue.js
CHANGED
|
@@ -2824,6 +2824,7 @@ export function registerRedBlueTools() {
|
|
|
2824
2824
|
// ─── Tool 2: Blue Team Harden ────────────────────────────────────────────────
|
|
2825
2825
|
registerTool({
|
|
2826
2826
|
name: 'blueteam_harden',
|
|
2827
|
+
deprecated: true,
|
|
2827
2828
|
description: 'Blue team: generate security hardening recommendations with ready-to-use code snippets. Produces security headers middleware, input validation patterns, auth hardening, crypto best practices, and logging/monitoring setup. Returns actionable code that can be directly applied.',
|
|
2828
2829
|
parameters: {
|
|
2829
2830
|
path: { type: 'string', description: 'Directory to analyze for context (default: current directory)' },
|
|
@@ -2941,6 +2942,7 @@ export function registerRedBlueTools() {
|
|
|
2941
2942
|
// ─── Tool 3: Red Team Report ─────────────────────────────────────────────────
|
|
2942
2943
|
registerTool({
|
|
2943
2944
|
name: 'redteam_report',
|
|
2945
|
+
deprecated: true,
|
|
2944
2946
|
description: 'Generate a professional penetration test report (defensive security assessment). Runs a full security audit and formats results as an executive assessment with risk score, attack surface mapping, critical findings with exploitation scenarios for context, risk matrix, and prioritized remediation plan. Defensive security context: use only on systems you own or have explicit permission to test.',
|
|
2945
2947
|
parameters: {
|
|
2946
2948
|
path: { type: 'string', description: 'Directory to assess (default: current directory)' },
|
|
@@ -3193,6 +3195,7 @@ export function registerRedBlueTools() {
|
|
|
3193
3195
|
// ─── Tool 4: Blue Team Checklist ─────────────────────────────────────────────
|
|
3194
3196
|
registerTool({
|
|
3195
3197
|
name: 'blueteam_checklist',
|
|
3198
|
+
deprecated: true,
|
|
3196
3199
|
description: 'Generate a comprehensive security hardening checklist tailored to a specific framework. Covers authentication, input validation, security headers, cryptography, logging, rate limiting, CORS/CSRF, dependency management, secrets, and infrastructure. Returns checkboxes for tracking completion.',
|
|
3197
3200
|
parameters: {
|
|
3198
3201
|
framework: { type: 'string', description: 'Framework: "express", "nextjs", "fastify", "django", "flask", "rails", "generic" (default: "generic")' },
|
|
@@ -3211,6 +3214,7 @@ export function registerRedBlueTools() {
|
|
|
3211
3214
|
// ─── Tool 5: Threat Model ────────────────────────────────────────────────────
|
|
3212
3215
|
registerTool({
|
|
3213
3216
|
name: 'threat_model',
|
|
3217
|
+
deprecated: true,
|
|
3214
3218
|
description: 'Perform threat modeling on a codebase. Analyzes code structure to identify data flows, trust boundaries, and threats. Supports STRIDE (Spoofing, Tampering, Repudiation, Information Disclosure, DoS, Elevation of Privilege), DREAD (Damage, Reproducibility, Exploitability, Affected Users, Discoverability), and PASTA (Process for Attack Simulation and Threat Analysis) methodologies.',
|
|
3215
3219
|
parameters: {
|
|
3216
3220
|
path: { type: 'string', description: 'Directory to analyze (default: current directory)' },
|
|
@@ -2196,6 +2196,7 @@ export function registerSecurityBrainTools() {
|
|
|
2196
2196
|
// ── Tool 1: security_brain ──────────────────────────────────────────
|
|
2197
2197
|
registerTool({
|
|
2198
2198
|
name: 'security_brain',
|
|
2199
|
+
deprecated: true,
|
|
2199
2200
|
description: 'Query the security knowledge base. Covers MITRE ATT&CK (14 tactics, 200+ techniques), OWASP Top 10 (2025), Lockheed Martin Kill Chain, CVE patterns, and kbot security tool mapping. Use this as a first stop for any security question.',
|
|
2200
2201
|
parameters: {
|
|
2201
2202
|
topic: { type: 'string', description: 'What to look up — technique name, vulnerability type, attack pattern, tool name, or general security topic', required: true },
|
|
@@ -2340,6 +2341,7 @@ export function registerSecurityBrainTools() {
|
|
|
2340
2341
|
// ── Tool 2: attack_lookup ───────────────────────────────────────────
|
|
2341
2342
|
registerTool({
|
|
2342
2343
|
name: 'attack_lookup',
|
|
2344
|
+
deprecated: true,
|
|
2343
2345
|
description: 'Look up MITRE ATT&CK techniques by ID (T1566) or keyword (phishing). Returns technique details including tactic, description, sub-techniques, detection methods, and mitigations. Covers all 14 ATT&CK tactics with top techniques for each.',
|
|
2344
2346
|
parameters: {
|
|
2345
2347
|
query: { type: 'string', description: 'Technique ID (e.g., T1566, T1059.001) or keyword (e.g., phishing, injection, credential dumping)', required: true },
|
|
@@ -2425,6 +2427,7 @@ export function registerSecurityBrainTools() {
|
|
|
2425
2427
|
// ── Tool 3: killchain_analyze ───────────────────────────────────────
|
|
2426
2428
|
registerTool({
|
|
2427
2429
|
name: 'killchain_analyze',
|
|
2430
|
+
deprecated: true,
|
|
2428
2431
|
description: 'Map an attack or vulnerability description to Lockheed Martin Kill Chain stages. Provides kill chain stage mapping with confidence levels, related MITRE ATT&CK techniques, OWASP entries, CVE patterns, and defensive recommendations with specific kbot tools.',
|
|
2429
2432
|
parameters: {
|
|
2430
2433
|
description: { type: 'string', description: 'Description of the attack, vulnerability, or threat scenario to analyze and map to kill chain stages', required: true },
|
|
@@ -621,6 +621,7 @@ function formatReport(report) {
|
|
|
621
621
|
export function registerSecurityHuntTools() {
|
|
622
622
|
registerTool({
|
|
623
623
|
name: 'security_hunt',
|
|
624
|
+
deprecated: true,
|
|
624
625
|
description: 'Defensive security audit — chains kbot\'s security scanners into a single comprehensive sweep. Scans for: open ports, SSL issues, missing headers, hardcoded secrets, dependency CVEs, supply chain risks, OWASP Top 10 code vulnerabilities, and dangerous patterns. Returns a scored report with severity ratings and fix recommendations. Defensive security context: use only on systems you own or have explicit permission to test.',
|
|
625
626
|
parameters: {
|
|
626
627
|
path: {
|
package/dist/tools/security.js
CHANGED
|
@@ -13,6 +13,7 @@ export function registerSecurityTools() {
|
|
|
13
13
|
// ─── Dependency Audit ───
|
|
14
14
|
registerTool({
|
|
15
15
|
name: 'dep_audit',
|
|
16
|
+
deprecated: true,
|
|
16
17
|
description: 'Audit project dependencies for known vulnerabilities. Runs npm audit, pip audit, or cargo audit depending on the project. Returns CVE IDs, severity, and fix recommendations.',
|
|
17
18
|
parameters: {
|
|
18
19
|
path: { type: 'string', description: 'Project directory to audit (default: current directory)' },
|
|
@@ -132,6 +133,7 @@ export function registerSecurityTools() {
|
|
|
132
133
|
// ─── Secret Scanner ───
|
|
133
134
|
registerTool({
|
|
134
135
|
name: 'secret_scan',
|
|
136
|
+
deprecated: true,
|
|
135
137
|
description: 'Scan files for accidentally committed secrets — API keys, tokens, passwords, private keys. Checks common patterns (AWS, Stripe, GitHub, Supabase, etc). Does NOT read .env files.',
|
|
136
138
|
parameters: {
|
|
137
139
|
path: { type: 'string', description: 'Directory to scan (default: current directory)' },
|
|
@@ -233,6 +235,7 @@ export function registerSecurityTools() {
|
|
|
233
235
|
// ─── SSL/TLS Check ───
|
|
234
236
|
registerTool({
|
|
235
237
|
name: 'ssl_check',
|
|
238
|
+
deprecated: true,
|
|
236
239
|
description: 'Check SSL/TLS certificate for any domain — expiry date, issuer, protocol, and security grade. Catches expiring certs before they break your site.',
|
|
237
240
|
parameters: {
|
|
238
241
|
domain: { type: 'string', description: 'Domain to check (e.g. "kernel.chat", "api.example.com")', required: true },
|
|
@@ -281,6 +284,7 @@ export function registerSecurityTools() {
|
|
|
281
284
|
// ─── Security Headers Check ───
|
|
282
285
|
registerTool({
|
|
283
286
|
name: 'headers_check',
|
|
287
|
+
deprecated: true,
|
|
284
288
|
description: 'Check HTTP security headers for any URL — CSP, HSTS, X-Frame-Options, etc. Reports missing headers that leave you vulnerable to XSS, clickjacking, and MIME sniffing.',
|
|
285
289
|
parameters: {
|
|
286
290
|
url: { type: 'string', description: 'URL to check (e.g. "https://kernel.chat")', required: true },
|
|
@@ -334,6 +338,7 @@ export function registerSecurityTools() {
|
|
|
334
338
|
// ─── CVE Lookup ───
|
|
335
339
|
registerTool({
|
|
336
340
|
name: 'cve_lookup',
|
|
341
|
+
deprecated: true,
|
|
337
342
|
description: 'Look up a CVE by ID or search for vulnerabilities affecting a specific package/product. Uses the NVD (National Vulnerability Database) API.',
|
|
338
343
|
parameters: {
|
|
339
344
|
query: { type: 'string', description: 'CVE ID (e.g. "CVE-2024-1234") or package name (e.g. "log4j", "openssl")', required: true },
|
|
@@ -475,6 +480,7 @@ export function registerSecurityTools() {
|
|
|
475
480
|
// ─── OWASP Quick Check ───
|
|
476
481
|
registerTool({
|
|
477
482
|
name: 'owasp_check',
|
|
483
|
+
deprecated: true,
|
|
478
484
|
description: 'Quick OWASP Top 10 check against a codebase. Scans for common vulnerability patterns: SQL injection, XSS, command injection, path traversal, hardcoded secrets, insecure deserialization.',
|
|
479
485
|
parameters: {
|
|
480
486
|
path: { type: 'string', description: 'Directory to scan (default: current directory)' },
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// lazy registry picks them up alongside everything else.
|
|
4
4
|
import { registerTool } from './index.js';
|
|
5
5
|
import { imageThoughtfulTool } from './image-thoughtful.js';
|
|
6
|
+
import { lladaImageTool } from './llada-image.js';
|
|
6
7
|
import { channelSendTool, channelReceiveTool } from './channel-tools.js';
|
|
7
8
|
import { fileLibraryAddTool, fileLibraryListTool, fileLibrarySearchTool, fileLibraryGetTool, } from './file-library-tools.js';
|
|
8
9
|
import { workspaceAgentTools } from './workspace-agent-tools.js';
|
|
@@ -72,6 +73,7 @@ function adaptSecurityTool(t) {
|
|
|
72
73
|
}
|
|
73
74
|
export function registerSwarm2026Tools() {
|
|
74
75
|
registerTool(imageThoughtfulTool);
|
|
76
|
+
registerTool(lladaImageTool);
|
|
75
77
|
registerTool(channelSendTool);
|
|
76
78
|
registerTool(channelReceiveTool);
|
|
77
79
|
registerTool(fileLibraryAddTool);
|
|
@@ -501,6 +501,7 @@ function runTests(projectPath, opts = {}) {
|
|
|
501
501
|
export function registerTestRunnerTools() {
|
|
502
502
|
registerTool({
|
|
503
503
|
name: 'run_tests',
|
|
504
|
+
deprecated: true,
|
|
504
505
|
description: 'Run project tests. Auto-detects the test framework (vitest, jest, pytest, cargo, go, npm) by checking config files, runs tests, and returns structured pass/fail results with failure details the agent can use to auto-fix issues.',
|
|
505
506
|
parameters: {
|
|
506
507
|
path: { type: 'string', description: 'Project root path. Defaults to current working directory.' },
|
|
@@ -856,6 +856,7 @@ export function registerThreatIntelTools() {
|
|
|
856
856
|
// ─── 1. threat_feed ─────────────────────────────────────────────────────────
|
|
857
857
|
registerTool({
|
|
858
858
|
name: 'threat_feed',
|
|
859
|
+
deprecated: true,
|
|
859
860
|
description: 'Aggregate cyber threat intelligence from free public sources. Fetches recent high/critical CVEs from NIST NVD, recent exploits from Exploit-DB, and optionally matches against your tech stack (from dream journal insights). Returns top threats with severity, affected software, and stack relevance.',
|
|
860
861
|
parameters: {
|
|
861
862
|
days: { type: 'number', description: 'Look-back period in days (default: 7, max: 30)' },
|
|
@@ -1285,6 +1286,7 @@ export function registerThreatIntelTools() {
|
|
|
1285
1286
|
// ─── 4. incident_response ───────────────────────────────────────────────────
|
|
1286
1287
|
registerTool({
|
|
1287
1288
|
name: 'incident_response',
|
|
1289
|
+
deprecated: true,
|
|
1288
1290
|
description: 'Generate an incident response playbook for a security incident. Given an incident type and description, produces a structured playbook with containment steps, eradication plan, recovery checklist, lessons learned template, and IOC indicators. Uses local Ollama for contextual AI analysis when available. Incident types: ransomware, data_breach, ddos, insider_threat, supply_chain.',
|
|
1289
1291
|
parameters: {
|
|
1290
1292
|
incident_type: { type: 'string', description: 'Type of incident: ransomware, data_breach, ddos, insider_threat, supply_chain', required: true },
|
package/dist/ui.js
CHANGED
|
@@ -123,7 +123,7 @@ export function banner(version) {
|
|
|
123
123
|
? gradient('kbot', [167, 139, 250], [103, 232, 249])
|
|
124
124
|
: ACCENT('kbot');
|
|
125
125
|
const title = ` ${bannerText}${v}`;
|
|
126
|
-
const features = DIM(' Web search: free • 35 agents •
|
|
126
|
+
const features = DIM(' Web search: free • 35 specialist agents • 100+ skills • bring your own key');
|
|
127
127
|
return `\n${grid}\n${title}\n${features}\n`;
|
|
128
128
|
}
|
|
129
129
|
export function bannerCompact() {
|
|
@@ -283,7 +283,7 @@ export function printHelp() {
|
|
|
283
283
|
` ${CYAN('https://kernel.chat')} ${DIM('Web companion')}`,
|
|
284
284
|
` ${CYAN('https://github.com/isaacsight/kernel')} ${DIM('GitHub')}`,
|
|
285
285
|
'',
|
|
286
|
-
` ${DIM('35 specialist agents.
|
|
286
|
+
` ${DIM('35 specialist agents. 100+ skills. Type anything to get started.')}`,
|
|
287
287
|
'',
|
|
288
288
|
];
|
|
289
289
|
status(lines.join('\n'));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kernel.chat/kbot",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Open-source terminal AI agent.
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Open-source terminal AI agent. 100+ specialist skills, 35 specialist agents, 20 providers. Dreams, learns, watches your system. Controls your phone. Fully local, fully sovereign. MIT. v4.0 — evidence-based curation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|