@meetopenbot/openbot 1.2.11 → 1.2.12
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/context.js +4 -3
- package/dist/tools/storage.js +23 -5
- package/package.json +1 -1
package/dist/context.js
CHANGED
|
@@ -101,9 +101,10 @@ export async function buildContext(state, storage, host) {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
// 2.6 Installed Agents
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
const otherAgents = allAgents.filter((agent) => agent.id !== agentId);
|
|
105
|
+
if (otherAgents.length > 0) {
|
|
106
|
+
const catalogs = await loadAgentModelCatalogs(storage, otherAgents.map((agent) => agent.id));
|
|
107
|
+
sections.push(formatInstalledAgentsSection(otherAgents, catalogs));
|
|
107
108
|
}
|
|
108
109
|
// 2.7 Marketplace agents not yet installed
|
|
109
110
|
if (host?.listMarketplaceAgents) {
|
package/dist/tools/storage.js
CHANGED
|
@@ -15,18 +15,34 @@ function displayNameFromChannelId(channelId) {
|
|
|
15
15
|
.join(' ');
|
|
16
16
|
}
|
|
17
17
|
async function emitCreateChannelWidget(ctx, args) {
|
|
18
|
+
const actions = args.state === 'submitted' && args.channelUrl
|
|
19
|
+
? [
|
|
20
|
+
{
|
|
21
|
+
id: 'navigate',
|
|
22
|
+
label: args.channelId ? `Open #${args.channelId}` : 'Open Space',
|
|
23
|
+
variant: 'primary',
|
|
24
|
+
value: { path: args.channelUrl },
|
|
25
|
+
},
|
|
26
|
+
]
|
|
27
|
+
: undefined;
|
|
18
28
|
await ctx.emit({
|
|
19
29
|
type: 'client:ui:widget',
|
|
20
30
|
data: {
|
|
21
31
|
widgetId: args.widgetId,
|
|
22
32
|
kind: 'message',
|
|
23
|
-
title: '
|
|
24
|
-
description: args.channelId
|
|
33
|
+
title: 'Space created',
|
|
34
|
+
description: args.displayName ?? (args.channelId ? `#${args.channelId}` : undefined),
|
|
25
35
|
body: args.body,
|
|
26
|
-
display: 'collapsed',
|
|
36
|
+
display: args.state === 'submitted' ? 'expanded' : 'collapsed',
|
|
27
37
|
state: args.state,
|
|
38
|
+
...(actions ? { actions } : {}),
|
|
39
|
+
metadata: { type: 'space_created', channelId: args.channelId || undefined },
|
|
40
|
+
},
|
|
41
|
+
meta: {
|
|
42
|
+
agentId: ctx.agentId,
|
|
43
|
+
threadId: ctx.threadId ?? ctx.state.threadId,
|
|
44
|
+
parentToolCallId: ctx.toolCallId,
|
|
28
45
|
},
|
|
29
|
-
meta: { agentId: ctx.agentId, threadId: ctx.threadId ?? ctx.state.threadId },
|
|
30
46
|
});
|
|
31
47
|
}
|
|
32
48
|
export const storageTools = {
|
|
@@ -119,10 +135,12 @@ export const storageTools = {
|
|
|
119
135
|
spec: channelSpec,
|
|
120
136
|
initialState: mergedInitial,
|
|
121
137
|
});
|
|
122
|
-
const output = `Created
|
|
138
|
+
const output = `Created #${rawChannelId}. Open it to start working there.`;
|
|
123
139
|
await emitCreateChannelWidget(ctx, {
|
|
124
140
|
widgetId,
|
|
125
141
|
channelId: rawChannelId,
|
|
142
|
+
displayName: displayName,
|
|
143
|
+
channelUrl,
|
|
126
144
|
body: output,
|
|
127
145
|
state: 'submitted',
|
|
128
146
|
});
|