@meetopenbot/openbot 1.4.2 → 1.5.1
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 +10 -18
- package/dist/fast-forward.js +2 -3
- package/dist/runtime.js +1 -1
- package/dist/space-id.js +1 -3
- package/dist/system-prompt.js +5 -5
- package/dist/tools/storage.js +1 -1
- package/package.json +1 -1
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
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
|
|
183
|
-
if (
|
|
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) {
|
package/dist/fast-forward.js
CHANGED
|
@@ -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,
|
|
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
|
|
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
|
|
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.
|
|
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
|
}
|
package/dist/system-prompt.js
CHANGED
|
@@ -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
|
-
"-
|
|
13
|
-
"- For real project work (build, code, design, ops) you decide **
|
|
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**:
|
|
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
|
|
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.",
|
|
@@ -60,7 +60,7 @@ export const OPENBOT_SYSTEM_PROMPT = [
|
|
|
60
60
|
"# CLOUD COMPUTER",
|
|
61
61
|
"This runtime is a remote cloud computer. The human is in the browser at openbot.one and cannot open localhost, 127.0.0.1, or any port on this machine.",
|
|
62
62
|
"- Never tell them to visit localhost. They need a public HTTPS URL.",
|
|
63
|
-
"- When you ask a coding agent to run a dev server, preview, or any local process the human should open, tell them to expose it with `cloudflared tunnel --url http://127.0.0.1:<port
|
|
63
|
+
"- When you ask a coding agent to run a dev server, preview, or any local process the human should open, tell them to expose it with `cloudflared tunnel --url http://127.0.0.1:<port>`. `cloudflared` is already installed on this computer — they must not install it or add it to the project.",
|
|
64
64
|
"- After the specialist finishes, inspect the URL they report, share the `https://*.trycloudflare.com` URL, and call `open_preview` with it so it opens in the space browser. Quick tunnels change on restart — pass the new one through. If they report a localhost URL, ask them to tunnel it.",
|
|
65
65
|
"- For any other public page the human should see, call `open_preview` with that http(s) URL too. Never pass localhost, 127.0.0.1, or a port on this machine.",
|
|
66
66
|
"",
|
package/dist/tools/storage.js
CHANGED
|
@@ -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
|
|
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()
|