negotium 0.5.8 → 0.5.9
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/agent-helpers.js +8 -38
- package/dist/agent-helpers.js.map +9 -9
- package/dist/hosted-agent.js +2 -2
- package/dist/hosted-agent.js.map +2 -2
- package/dist/main.js +8 -36
- package/dist/main.js.map +8 -8
- package/dist/mcp-factories.js +6 -14
- package/dist/mcp-factories.js.map +6 -6
- package/dist/prompts.js +2 -2
- package/dist/prompts.js.map +3 -3
- package/dist/registry.js +2 -2
- package/dist/registry.js.map +2 -2
- package/dist/runtime/src/agents/mcp-tools/visual-compat.ts +1 -7
- package/dist/runtime/src/agents/mcp-tools/visuals.ts +1 -29
- package/dist/runtime/src/agents/public-helpers.ts +0 -1
- package/dist/runtime/src/prompts/builders.ts +2 -2
- package/dist/runtime/src/runtime/turn-event-stream.ts +3 -8
- package/dist/runtime/src/runtime/visuals.ts +0 -4
- package/dist/runtime/src/version.ts +1 -1
- package/dist/types/packages/core/src/agents/mcp-tools/visual-compat.d.ts +0 -9
- package/dist/types/packages/core/src/agents/mcp-tools/visuals.d.ts +0 -19
- package/dist/types/packages/core/src/agents/public-helpers.d.ts +1 -1
- package/dist/types/packages/core/src/runtime/visuals.d.ts +0 -1
- package/dist/types/packages/core/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -57,32 +57,4 @@ export const showImageTool = {
|
|
|
57
57
|
},
|
|
58
58
|
} satisfies SharedMcpTool;
|
|
59
59
|
|
|
60
|
-
export const
|
|
61
|
-
name: "show_video",
|
|
62
|
-
description:
|
|
63
|
-
"Display a playable video in the user's visual side panel. Provide either file_path for a video in the topic workspace, or file_id for an uploaded file already attached in this topic.",
|
|
64
|
-
schema: {
|
|
65
|
-
file_path: z
|
|
66
|
-
.string()
|
|
67
|
-
.optional()
|
|
68
|
-
.describe("Absolute or workspace-relative path to a video file."),
|
|
69
|
-
file_id: z
|
|
70
|
-
.string()
|
|
71
|
-
.optional()
|
|
72
|
-
.describe("Full Otium uploaded file UUID for a video attached in this topic."),
|
|
73
|
-
title: z.string().optional().describe("Optional title shown above the rendered card."),
|
|
74
|
-
},
|
|
75
|
-
async handler(input) {
|
|
76
|
-
if (!input?.file_path && !input?.file_id) {
|
|
77
|
-
return errorResult("file_path or file_id is required.");
|
|
78
|
-
}
|
|
79
|
-
return textResult("Video displayed to the user.");
|
|
80
|
-
},
|
|
81
|
-
} satisfies SharedMcpTool;
|
|
82
|
-
|
|
83
|
-
export const visualToolDefinitions = [
|
|
84
|
-
showHtmlTool,
|
|
85
|
-
showMermaidTool,
|
|
86
|
-
showImageTool,
|
|
87
|
-
showVideoTool,
|
|
88
|
-
] as const;
|
|
60
|
+
export const visualToolDefinitions = [showHtmlTool, showMermaidTool, showImageTool] as const;
|
|
@@ -310,8 +310,8 @@ function buildRuntimeToolSection(
|
|
|
310
310
|
: `For diagrams that Mermaid supports, prefer the MCP tool "${runtimeNamespace}__show_mermaid" with { code: "<Mermaid DSL without markdown fences>", title?: "...", theme?: "neutral" }.`;
|
|
311
311
|
const mediaToolLine =
|
|
312
312
|
agentKind === "codex"
|
|
313
|
-
? `To display an existing image
|
|
314
|
-
: `To display an existing image
|
|
313
|
+
? `To display an existing image in the visual panel, use \`show_image\` in the \`${runtimeNamespace}\` namespace with either { file_path: "...", title?: "..." } for a topic-workspace file or { file_id: "...", title?: "..." } for an uploaded file already attached in this topic.`
|
|
314
|
+
: `To display an existing image in the visual panel, use MCP tool "${runtimeNamespace}__show_image" with either { file_path: "...", title?: "..." } for a topic-workspace file or { file_id: "...", title?: "..." } for an uploaded file already attached in this topic.`;
|
|
315
315
|
const sendFileTool =
|
|
316
316
|
agentKind === "codex"
|
|
317
317
|
? `\`send_file\` function in the \`${runtimeNamespace}\` namespace`
|
|
@@ -52,7 +52,6 @@ import {
|
|
|
52
52
|
isVisualsShowHtmlTool,
|
|
53
53
|
isVisualsShowImageTool,
|
|
54
54
|
isVisualsShowMermaidTool,
|
|
55
|
-
isVisualsShowVideoTool,
|
|
56
55
|
normalizeMermaidTheme,
|
|
57
56
|
normalizeToolUseId,
|
|
58
57
|
resolveVisualMediaInput,
|
|
@@ -464,14 +463,14 @@ export async function runTurnEventStream(
|
|
|
464
463
|
broadcastStoredVisual(event, vizId, title, "mermaid");
|
|
465
464
|
}
|
|
466
465
|
}
|
|
467
|
-
} else if (isVisualsShowImageTool(event.name)
|
|
466
|
+
} else if (isVisualsShowImageTool(event.name)) {
|
|
468
467
|
const input = event.input as {
|
|
469
468
|
file_path?: unknown;
|
|
470
469
|
file_id?: unknown;
|
|
471
470
|
title?: unknown;
|
|
472
471
|
alt?: unknown;
|
|
473
472
|
};
|
|
474
|
-
const kind =
|
|
473
|
+
const kind = "image" as const;
|
|
475
474
|
const toolUseId = bindToolUseId(event.toolUseId);
|
|
476
475
|
const label = formatToolUse(event.name, event.input);
|
|
477
476
|
const failMediaVisual = (reason: string) => {
|
|
@@ -506,14 +505,10 @@ export async function runTurnEventStream(
|
|
|
506
505
|
failMediaVisual(media.error);
|
|
507
506
|
break;
|
|
508
507
|
}
|
|
509
|
-
if (
|
|
508
|
+
if (!media.mimeType.startsWith("image/")) {
|
|
510
509
|
failMediaVisual(`expected image media, got ${media.mimeType}`);
|
|
511
510
|
break;
|
|
512
511
|
}
|
|
513
|
-
if (kind === "video" && !media.mimeType.startsWith("video/")) {
|
|
514
|
-
failMediaVisual(`expected video media, got ${media.mimeType}`);
|
|
515
|
-
break;
|
|
516
|
-
}
|
|
517
512
|
try {
|
|
518
513
|
const title = normalizeVisualTitle(input.title);
|
|
519
514
|
if (peerBridge) {
|
|
@@ -51,10 +51,6 @@ export function isVisualsShowImageTool(name: string): boolean {
|
|
|
51
51
|
return isRuntimeTool(name, "show_image") || isRuntimeTool(name, "show_png");
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export function isVisualsShowVideoTool(name: string): boolean {
|
|
55
|
-
return isRuntimeTool(name, "show_video");
|
|
56
|
-
}
|
|
57
|
-
|
|
58
54
|
export function normalizeToolUseId(value: string | undefined): string | undefined {
|
|
59
55
|
const normalized = value?.trim();
|
|
60
56
|
return normalized ? normalized : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const NEGOTIUM_VERSION = "0.5.
|
|
1
|
+
export const NEGOTIUM_VERSION = "0.5.9";
|
|
@@ -52,13 +52,4 @@ export declare const otiumVisualToolDefinitions: readonly [{
|
|
|
52
52
|
alt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
53
53
|
};
|
|
54
54
|
handler: (input: any) => Promise<import("./common").McpToolResult>;
|
|
55
|
-
}, {
|
|
56
|
-
name: string;
|
|
57
|
-
description: string;
|
|
58
|
-
schema: {
|
|
59
|
-
file_path: import("zod").ZodOptional<import("zod").ZodString>;
|
|
60
|
-
file_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
61
|
-
title: import("zod").ZodOptional<import("zod").ZodString>;
|
|
62
|
-
};
|
|
63
|
-
handler(input: any): Promise<import("./common").McpToolResult>;
|
|
64
55
|
}];
|
|
@@ -35,16 +35,6 @@ export declare const showImageTool: {
|
|
|
35
35
|
};
|
|
36
36
|
handler(input: any): Promise<import("./common").McpToolResult>;
|
|
37
37
|
};
|
|
38
|
-
export declare const showVideoTool: {
|
|
39
|
-
name: string;
|
|
40
|
-
description: string;
|
|
41
|
-
schema: {
|
|
42
|
-
file_path: z.ZodOptional<z.ZodString>;
|
|
43
|
-
file_id: z.ZodOptional<z.ZodString>;
|
|
44
|
-
title: z.ZodOptional<z.ZodString>;
|
|
45
|
-
};
|
|
46
|
-
handler(input: any): Promise<import("./common").McpToolResult>;
|
|
47
|
-
};
|
|
48
38
|
export declare const visualToolDefinitions: readonly [{
|
|
49
39
|
name: string;
|
|
50
40
|
description: string;
|
|
@@ -77,13 +67,4 @@ export declare const visualToolDefinitions: readonly [{
|
|
|
77
67
|
alt: z.ZodOptional<z.ZodString>;
|
|
78
68
|
};
|
|
79
69
|
handler(input: any): Promise<import("./common").McpToolResult>;
|
|
80
|
-
}, {
|
|
81
|
-
name: string;
|
|
82
|
-
description: string;
|
|
83
|
-
schema: {
|
|
84
|
-
file_path: z.ZodOptional<z.ZodString>;
|
|
85
|
-
file_id: z.ZodOptional<z.ZodString>;
|
|
86
|
-
title: z.ZodOptional<z.ZodString>;
|
|
87
|
-
};
|
|
88
|
-
handler(input: any): Promise<import("./common").McpToolResult>;
|
|
89
70
|
}];
|
|
@@ -8,7 +8,7 @@ export { createPublishHtmlToolDefinitions, type PublishHtmlContext, } from "./mc
|
|
|
8
8
|
export { createSelfConfigRuntime, createSelfConfigToolDefinitionsForCore, type SelfConfigRuntime, type SelfConfigRuntimeOptions, } from "./mcp-tools/self-config";
|
|
9
9
|
export { createSubagentLifecycle, type SpawnSubagentToolContext, type SubagentLifecycle, type SubagentLifecycleHost, type SubagentLifecycleLimits, type SubagentToolContext, type SubagentWatch, } from "./mcp-tools/spawn-subagent";
|
|
10
10
|
export { otiumVisualToolDefinitions, showPngTool, } from "./mcp-tools/visual-compat";
|
|
11
|
-
export { showHtmlTool, showImageTool, showMermaidTool,
|
|
11
|
+
export { showHtmlTool, showImageTool, showMermaidTool, VISUALS_MCP_KEY, visualToolDefinitions, } from "./mcp-tools/visuals";
|
|
12
12
|
export { MIN_MEMORY_ARCHIVE_EXCHANGES } from "./memory-archive-policy";
|
|
13
13
|
export { createSelfConfigCore, DEFAULT_SELF_CONFIG_PRODUCT, type SelfConfigAgentPolicy, type SelfConfigAgentSwitchOptions, type SelfConfigAgentSwitchResult, type SelfConfigContext, type SelfConfigCore, type SelfConfigCreateScheduleResult, type SelfConfigDerivedTopics, type SelfConfigField, type SelfConfigHost, type SelfConfigModelPolicy, type SelfConfigProductConfig, type SelfConfigResult, type SelfConfigRuntimeBoundary, type SelfConfigSchedule, type SelfConfigSchedules, type SelfConfigTopic, type SelfConfigTopicConfig, type SelfConfigTopicStore, } from "./self-config-core";
|
|
14
14
|
export { resolveTaskEventScope, type TaskEventHost, type TaskEventScope, withTaskSnapshots, } from "./task-events";
|
|
@@ -7,7 +7,6 @@ export declare function isRuntimeTool(name: string, toolName: string): boolean;
|
|
|
7
7
|
export declare function isVisualsShowHtmlTool(name: string): boolean;
|
|
8
8
|
export declare function isVisualsShowMermaidTool(name: string): boolean;
|
|
9
9
|
export declare function isVisualsShowImageTool(name: string): boolean;
|
|
10
|
-
export declare function isVisualsShowVideoTool(name: string): boolean;
|
|
11
10
|
export declare function normalizeToolUseId(value: string | undefined): string | undefined;
|
|
12
11
|
export declare function escapeHtml(value: string): string;
|
|
13
12
|
export declare function stripMermaidFence(value: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const NEGOTIUM_VERSION = "0.5.
|
|
1
|
+
export declare const NEGOTIUM_VERSION = "0.5.9";
|