@meetopenbot/openbot 1.4.2 → 1.5.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/dist/context.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { formatGitIdentity, readGitIdentity, } from "@meetopenbot/plugin-sdk";
2
2
  import { formatAvailableAgentsSection, formatInstalledAgentsSection, loadAgentModelCatalogs, availableMarketplaceAgents, } from "./agent-models.js";
3
- import { GENERAL_SPACE_ID } from "./space-id.js";
4
3
  import { todoService } from "./tools/todo-service.js";
5
4
  import { readInvokeSurface, surfaceSection } from "./surface.js";
6
5
  export const DEFAULT_CONTEXT_BUDGET = 8000;
@@ -48,22 +47,16 @@ export async function buildContext(state, storage, host) {
48
47
  // 2. Environment
49
48
  let env = "## ENVIRONMENT\n";
50
49
  const spaceName = channelDetails?.name || channelId;
51
- const isGeneral = channelId === GENERAL_SPACE_ID;
52
50
  env += `- Space: #${channelId || "unknown"} (${spaceName || channelId})\n`;
53
- env += isGeneral
54
- ? "- Role: inbox — answer questions, listings, setup, and routing here; for project work, name the right Space from `## SPACES` and ask the human to post there\n"
55
- : "- Role: dedicated Space — do the work here with `ask_agent`\n";
56
51
  if (channelDetails?.cwd) {
57
52
  env += `- Workspace: ${channelDetails.cwd}\n`;
58
- if (!isGeneral) {
59
- try {
60
- const git = readGitIdentity(channelDetails.cwd);
61
- if (git)
62
- env += `- Git: ${formatGitIdentity(git)}\n`;
63
- }
64
- catch (error) {
65
- console.warn("[context] Failed to read git identity:", error);
66
- }
53
+ try {
54
+ const git = readGitIdentity(channelDetails.cwd);
55
+ if (git)
56
+ env += `- Git: ${formatGitIdentity(git)}\n`;
57
+ }
58
+ catch (error) {
59
+ console.warn("[context] Failed to read git identity:", error);
67
60
  }
68
61
  }
69
62
  if (threadId) {
@@ -164,8 +157,7 @@ export async function buildContext(state, storage, host) {
164
157
  // ignore spec lookup failures
165
158
  }
166
159
  }
167
- const inbox = space.id === GENERAL_SPACE_ID ? " [inbox]" : "";
168
- return `- ${space.id}: ${space.name || space.id}${inbox}${specHint}`;
160
+ return `- ${space.id}: ${space.name || space.id}${specHint}`;
169
161
  }))).join("\n");
170
162
  sections.push(`## SPACES\n${formatted}\n\nAnswer questions about available Spaces from this list. Do not create a Space to look them up.`);
171
163
  }
@@ -179,8 +171,8 @@ export async function buildContext(state, storage, host) {
179
171
  if (spec) {
180
172
  sections.push(`## SPACE SPEC\n${spec}`);
181
173
  }
182
- // 4. Files (dedicated Spaces only — general is an inbox)
183
- if (!isGeneral && storage?.listFiles && channelId && channelDetails?.cwd) {
174
+ // 4. Files
175
+ if (storage?.listFiles && channelId && channelDetails?.cwd) {
184
176
  try {
185
177
  const files = await storage.listFiles({ channelId });
186
178
  if (files.length > 0) {
@@ -1,6 +1,5 @@
1
1
  import { creditsProviderBaseUrl, resolveByokApiKey, resolveCreditsAuthConfig, shouldUseCreditsAuth, INTEGRATIONS_TOKEN_HEADER, } from '@meetopenbot/plugin-sdk';
2
2
  import { isAutoModel } from './auto-model.js';
3
- import { GENERAL_SPACE_ID } from './space-id.js';
4
3
  import { isManuallyNamedThread } from './thread-naming.js';
5
4
  /** Decisions model. Public beta supports only this id. */
6
5
  export const DECISION_MODEL = 'gpt-6-luna';
@@ -32,13 +31,13 @@ function isUserInvoke(event) {
32
31
  return eventData(event)?.role === 'user';
33
32
  }
34
33
  /**
35
- * Auto, dedicated Space, first user message, exactly one installed @mention,
34
+ * Auto, any Space, first user message, exactly one installed @mention,
36
35
  * no attachments. Anything else stays on the coordinator.
37
36
  */
38
37
  export function selectFastForwardCandidate(input) {
39
38
  if (!isAutoModel(input.model))
40
39
  return undefined;
41
- if (!input.channelId || input.channelId === GENERAL_SPACE_ID)
40
+ if (!input.channelId)
42
41
  return undefined;
43
42
  const userMessages = input.events.filter(isUserInvoke);
44
43
  if (userMessages.length !== 1)
package/dist/runtime.js CHANGED
@@ -149,7 +149,7 @@ async function suggestThreadTitle(args) {
149
149
  return sanitizeThreadTitle(result.text);
150
150
  }
151
151
  /**
152
- * On Auto, a first message in a dedicated Space that @mentions one installed
152
+ * On Auto, a first message in a Space that @mentions one installed
153
153
  * agent can skip the coordinator and ask that specialist immediately.
154
154
  * Returns true when the specialist already ran and the caller should close.
155
155
  */
package/dist/space-id.js CHANGED
@@ -1,5 +1,3 @@
1
- /** Default inbox Space. Wire id stays `general` (channelId). */
2
- export const GENERAL_SPACE_ID = "general";
3
1
  /** Dummy ids models invent when they feel forced to "place" work that has no Space. */
4
2
  const PLACEHOLDER_SPACE_IDS = new Set([
5
3
  "noop",
@@ -18,5 +16,5 @@ export function isPlaceholderSpaceId(spaceId) {
18
16
  return PLACEHOLDER_SPACE_IDS.has(spaceId);
19
17
  }
20
18
  export function placeholderSpaceError(spaceId) {
21
- return `Refused to create #${spaceId}: that looks like a placeholder, not a real Space. Stay in #general for questions and listings. If project work needs a new Space, propose a concrete name and wait for the human to agree.`;
19
+ return `Refused to create #${spaceId}: that looks like a placeholder, not a real Space. Keep working in the current Space, or ask the human what to name a new one.`;
22
20
  }
@@ -9,13 +9,13 @@ export const OPENBOT_SYSTEM_PROMPT = [
9
9
  "",
10
10
  "# CORE MISSION",
11
11
  "You are a high-level manager. Not every message is project work.",
12
- "- Questions, listings, setup, routing, and status stay in `#general`. Answer them from `## SPACES`, `## INSTALLED AGENTS`, and `## AVAILABLE AGENTS`. Do not create a Space to look anything up.",
13
- "- For real project work (build, code, design, ops) you decide **where** (which Space) and **who** (which installed agent), then ask that agent, close without restating their work, and keep todos current.",
12
+ "- Answer questions, listings, setup, and status directly from `## SPACES`, `## INSTALLED AGENTS`, and `## AVAILABLE AGENTS`. Do not create a Space to look anything up.",
13
+ "- For real project work (build, code, design, ops) you decide **who** (which installed agent), then ask that agent in the current Space, close without restating their work, and keep todos current.",
14
14
  "",
15
15
  "# THE AGENT LOOP",
16
16
  "You operate in an iterative loop:",
17
17
  "1. **Analyze Events**: Understand the human, mentioned people, the current Space, and `## SPACES`.",
18
- "2. **Right Space**: Use `## SPACES` to see where work belongs. If the human's intent clearly fits a different existing Space than the one you are in — especially project work posted in `#general` — explain in text which Space it belongs in and why. Then either wait for the human to continue there, or — when the request is clear enough to act on — call `start_thread` to open a thread in that Space with their request, written in their own first-person voice because it is posted as them; the human approves it before it starts. Never start a thread in the Space you are already in. In `#general`, handle questions, listings, setup, and routing only; do not run project execution there. If they are already in the right Space, continue with `ask_agent`. If no Space fits, propose a concrete name and why, then wait for the human to agree before `create_channel` — unless they already named a new Space or explicitly asked you to create it. Never invent placeholder ids (`noop`, `temp`, `misc`, `untitled`).",
18
+ "2. **Right Space**: Every Space, `#general` included, is a place to do work. Do it in the current Space by default. Only if the human's request clearly belongs to a different existing Space from `## SPACES` — for example it names that project — explain in text which Space it belongs in and why. Then either wait for the human to continue there, or — when the request is clear enough to act on — call `start_thread` to open a thread in that Space with their request, written in their own first-person voice because it is posted as them; the human approves it before it starts. Never start a thread in the Space you are already in. Otherwise continue here with `ask_agent`. Create a new Space only when the human named one or explicitly asked for it. Never invent placeholder ids (`noop`, `temp`, `misc`, `untitled`).",
19
19
  "3. **Ask people**: Use `ask_agent` to send a message to a specialist. Write it as a request to a colleague, not as a tool invocation.",
20
20
  "4. **Wait**: Let the asked agent run in its own harness. Read their reply, then continue or ask someone else.",
21
21
  "5. **Close**: The human already saw the specialist speak in this thread. Do not restate, re-bullet, or paraphrase their findings. Name who you asked, then add only what is new — a decision, a conflict, a next step, or a caveat. If nothing is new, close in one or two sentences.",
@@ -42,7 +42,7 @@ export const OPENBOT_SYSTEM_PROMPT = [
42
42
  "- The current status is injected each turn as `## THREAD STATUS`.",
43
43
  "",
44
44
  "# OPERATIONAL GUIDELINES",
45
- '- **Spaces**: Work lives in Spaces (product name for channels). `#general` is dispatch — setup, questions, listings, routing, and "what should we do next." Project, coding, design, and ops work belongs in a dedicated Space. Prefer existing Spaces. When the human is in the wrong existing Space, explain the appropriate Space in text, then let them continue there or hand it over with `start_thread`. Never auto-move threads or messages; `start_thread` opens a new thread and leaves this one in place. Create a new Space only when the human asked for one, or they agreed after you suggested it.',
45
+ '- **Spaces**: Work lives in Spaces (product name for channels). `#general` is the default Space and works like any other. Prefer existing Spaces. When the request clearly belongs to another existing Space, explain the appropriate Space in text, then let them continue there or hand it over with `start_thread`. Never auto-move threads or messages; `start_thread` opens a new thread and leaves this one in place. Create a new Space only when the human asked for one, or they agreed after you suggested it.',
46
46
  "- **Asking**: You ask specialists with `ask_agent`. If `## MENTIONED AGENTS` is present, you MUST ask those people. You may also ask others if needed. If nobody is mentioned, pick the best match from `## INSTALLED AGENTS` and tell the human who you asked.",
47
47
  "- **Models**: When you `ask_agent`, pick `model` from that agent's list in `## INSTALLED AGENTS` using the descriptions — cheaper/faster for simple work, stronger for complex coding or reasoning. Omit `model` to use their default. Do not reuse another agent's ids.",
48
48
  "- **Closer**: After `ask_agent`, you are the closer, not a second author of their work. Don't repeat. Add or close. When several people replied, write only the synthesis or decision — not a recap of each.",
@@ -47,7 +47,7 @@ async function emitCreateChannelWidget(ctx, args) {
47
47
  }
48
48
  export const storageTools = {
49
49
  create_channel: {
50
- description: 'Create a new Space after the human asked for it or agreed to your suggestion. Prefer an existing Space when pointing them where to work. Skip questions, listings, and Q&A in #general. Never use placeholder ids (noop, temp, misc).',
50
+ description: 'Create a new Space only when the human named one or explicitly asked for it. Never create a Space to answer a question or list things. Never use placeholder ids (noop, temp, misc).',
51
51
  inputSchema: z.object({
52
52
  channelId: z
53
53
  .string()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetopenbot/openbot",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
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",