@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 CHANGED
@@ -101,9 +101,10 @@ export async function buildContext(state, storage, host) {
101
101
  }
102
102
  }
103
103
  // 2.6 Installed Agents
104
- if (allAgents.length > 0) {
105
- const catalogs = await loadAgentModelCatalogs(storage, allAgents.map((agent) => agent.id));
106
- sections.push(formatInstalledAgentsSection(allAgents, catalogs));
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) {
@@ -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: 'create_channel',
24
- description: args.channelId || undefined,
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 channel \`${rawChannelId}\`.`;
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetopenbot/openbot",
3
- "version": "1.2.11",
3
+ "version": "1.2.12",
4
4
  "description": "OpenBot coordinator runtime: ask specialists, route work into Spaces, and track todos.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",