morpheus-cli 0.7.4 → 0.7.5
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/dist/config/manager.js +1 -0
- package/dist/config/schemas.js +1 -0
- package/dist/runtime/providers/factory.js +14 -0
- package/dist/runtime/tools/apoc-tool.js +6 -0
- package/dist/runtime/tools/morpheus-tools.js +1 -0
- package/dist/runtime/tools/neo-tool.js +6 -0
- package/dist/runtime/tools/trinity-tool.js +6 -0
- package/dist/types/config.js +2 -1
- package/dist/ui/assets/{index-CsMDzmtQ.js → index-DlwA5wEh.js} +13 -13
- package/dist/ui/index.html +1 -1
- package/dist/ui/sw.js +1 -1
- package/package.json +1 -1
package/dist/config/manager.js
CHANGED
package/dist/config/schemas.js
CHANGED
|
@@ -67,6 +67,7 @@ export const ConfigSchema = z.object({
|
|
|
67
67
|
}).default(DEFAULT_CONFIG.runtime?.async_tasks ?? { enabled: true }),
|
|
68
68
|
}).optional(),
|
|
69
69
|
chronos: ChronosConfigSchema.optional(),
|
|
70
|
+
verbose_mode: z.boolean().default(true),
|
|
70
71
|
channels: z.object({
|
|
71
72
|
telegram: z.object({
|
|
72
73
|
enabled: z.boolean().default(false),
|
|
@@ -6,6 +6,11 @@ import { ProviderError } from "../errors.js";
|
|
|
6
6
|
import { createAgent, createMiddleware } from "langchain";
|
|
7
7
|
import { DisplayManager } from "../display.js";
|
|
8
8
|
import { getUsableApiKey } from "../trinity-crypto.js";
|
|
9
|
+
import { ConfigManager } from "../../config/manager.js";
|
|
10
|
+
import { TaskRequestContext } from "../tasks/context.js";
|
|
11
|
+
import { ChannelRegistry } from "../../channels/registry.js";
|
|
12
|
+
/** Channels that should NOT receive verbose tool notifications */
|
|
13
|
+
const SILENT_CHANNELS = new Set(['api', 'ui']);
|
|
9
14
|
export class ProviderFactory {
|
|
10
15
|
static buildMonitoringMiddleware() {
|
|
11
16
|
const display = DisplayManager.getInstance();
|
|
@@ -14,6 +19,15 @@ export class ProviderFactory {
|
|
|
14
19
|
wrapToolCall: (request, handler) => {
|
|
15
20
|
display.log(`Executing tool: ${request.toolCall.name}`, { level: "warning", source: 'ConstructLoad' });
|
|
16
21
|
display.log(`Arguments: ${JSON.stringify(request.toolCall.args)}`, { level: "info", source: 'ConstructLoad' });
|
|
22
|
+
// Verbose mode: notify originating channel about which tool is running
|
|
23
|
+
const verboseEnabled = ConfigManager.getInstance().get().verbose_mode !== false;
|
|
24
|
+
if (verboseEnabled) {
|
|
25
|
+
const ctx = TaskRequestContext.get();
|
|
26
|
+
if (ctx?.origin_channel && ctx.origin_user_id && !SILENT_CHANNELS.has(ctx.origin_channel)) {
|
|
27
|
+
ChannelRegistry.sendToUser(ctx.origin_channel, ctx.origin_user_id, `🔧 executing: ${request.toolCall.name}`)
|
|
28
|
+
.catch(() => { });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
17
31
|
try {
|
|
18
32
|
const result = handler(request);
|
|
19
33
|
display.log(`Tool completed successfully. Result: ${JSON.stringify(result)}`, { level: "info", source: 'ConstructLoad' });
|
|
@@ -6,6 +6,7 @@ import { compositeDelegationError, isLikelyCompositeDelegationTask } from "./del
|
|
|
6
6
|
import { DisplayManager } from "../display.js";
|
|
7
7
|
import { ConfigManager } from "../../config/manager.js";
|
|
8
8
|
import { Apoc } from "../apoc.js";
|
|
9
|
+
import { ChannelRegistry } from "../../channels/registry.js";
|
|
9
10
|
/**
|
|
10
11
|
* Returns true when Apoc is configured to execute synchronously (inline).
|
|
11
12
|
*/
|
|
@@ -42,6 +43,11 @@ export const ApocDelegateTool = tool(async ({ task, context }) => {
|
|
|
42
43
|
});
|
|
43
44
|
const ctx = TaskRequestContext.get();
|
|
44
45
|
const sessionId = ctx?.session_id ?? "default";
|
|
46
|
+
// Notify originating channel that the agent is working
|
|
47
|
+
if (ctx?.origin_channel && ctx.origin_user_id && ctx.origin_channel !== 'api' && ctx.origin_channel !== 'ui') {
|
|
48
|
+
ChannelRegistry.sendToUser(ctx.origin_channel, ctx.origin_user_id, '🧑🔬 Apoc is executing your request...')
|
|
49
|
+
.catch(() => { });
|
|
50
|
+
}
|
|
45
51
|
const apoc = Apoc.getInstance();
|
|
46
52
|
const result = await apoc.execute(task, context, sessionId);
|
|
47
53
|
TaskRequestContext.incrementSyncDelegation();
|
|
@@ -46,6 +46,7 @@ const CONFIG_TO_ENV_MAP = {
|
|
|
46
46
|
'audio.model': ['MORPHEUS_AUDIO_MODEL'],
|
|
47
47
|
'audio.apiKey': ['MORPHEUS_AUDIO_API_KEY'],
|
|
48
48
|
'audio.maxDurationSeconds': ['MORPHEUS_AUDIO_MAX_DURATION'],
|
|
49
|
+
'verbose_mode': ['MORPHEUS_VERBOSE_MODE'],
|
|
49
50
|
};
|
|
50
51
|
/**
|
|
51
52
|
* Checks if a config field is overridden by an environment variable.
|
|
@@ -6,6 +6,7 @@ import { compositeDelegationError, isLikelyCompositeDelegationTask } from "./del
|
|
|
6
6
|
import { DisplayManager } from "../display.js";
|
|
7
7
|
import { ConfigManager } from "../../config/manager.js";
|
|
8
8
|
import { Neo } from "../neo.js";
|
|
9
|
+
import { ChannelRegistry } from "../../channels/registry.js";
|
|
9
10
|
const NEO_BUILTIN_CAPABILITIES = `
|
|
10
11
|
Neo built-in capabilities (always available — no MCP required):
|
|
11
12
|
• Config: morpheus_config_query, morpheus_config_update — read/write Morpheus configuration (LLM, channels, UI, etc.)
|
|
@@ -70,6 +71,11 @@ export const NeoDelegateTool = tool(async ({ task, context }) => {
|
|
|
70
71
|
});
|
|
71
72
|
const ctx = TaskRequestContext.get();
|
|
72
73
|
const sessionId = ctx?.session_id ?? "default";
|
|
74
|
+
// Notify originating channel that the agent is working
|
|
75
|
+
if (ctx?.origin_channel && ctx.origin_user_id && ctx.origin_channel !== 'api' && ctx.origin_channel !== 'ui') {
|
|
76
|
+
ChannelRegistry.sendToUser(ctx.origin_channel, ctx.origin_user_id, '🥷 Neo is executing your request...')
|
|
77
|
+
.catch(() => { });
|
|
78
|
+
}
|
|
73
79
|
const neo = Neo.getInstance();
|
|
74
80
|
const result = await neo.execute(task, context, sessionId, {
|
|
75
81
|
origin_channel: ctx?.origin_channel ?? "api",
|
|
@@ -6,6 +6,7 @@ import { compositeDelegationError, isLikelyCompositeDelegationTask } from "./del
|
|
|
6
6
|
import { DisplayManager } from "../display.js";
|
|
7
7
|
import { ConfigManager } from "../../config/manager.js";
|
|
8
8
|
import { Trinity } from "../trinity.js";
|
|
9
|
+
import { ChannelRegistry } from "../../channels/registry.js";
|
|
9
10
|
const TRINITY_BASE_DESCRIPTION = `Delegate a database task to Trinity, the specialized database subagent, asynchronously.
|
|
10
11
|
|
|
11
12
|
This tool enqueues a background task and returns an acknowledgement with task id.
|
|
@@ -57,6 +58,11 @@ export const TrinityDelegateTool = tool(async ({ task, context }) => {
|
|
|
57
58
|
});
|
|
58
59
|
const ctx = TaskRequestContext.get();
|
|
59
60
|
const sessionId = ctx?.session_id ?? 'default';
|
|
61
|
+
// Notify originating channel that the agent is working
|
|
62
|
+
if (ctx?.origin_channel && ctx.origin_user_id && ctx.origin_channel !== 'api' && ctx.origin_channel !== 'ui') {
|
|
63
|
+
ChannelRegistry.sendToUser(ctx.origin_channel, ctx.origin_user_id, '👩💻 Trinity is executing your request...')
|
|
64
|
+
.catch(() => { });
|
|
65
|
+
}
|
|
60
66
|
const trinity = Trinity.getInstance();
|
|
61
67
|
const result = await trinity.execute(task, context, sessionId);
|
|
62
68
|
TaskRequestContext.incrementSyncDelegation();
|