Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 23 additions & 29 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 18 additions & 3 deletions lib/rpc-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,15 @@ function appendSlashCommand(
*/
export const BROWSER_NATIVE_SLASH_COMMANDS = ["fork", "goal"] as const;

/**
* Registry metadata that does not describe the browser handler. omp 18.10 gave
* /fork pane/window/tab subcommands that open the fork in a terminal
* multiplexer; the browser fork ignores them, so it keeps its own description.
*/
const BROWSER_NATIVE_DESCRIPTIONS: Partial<Record<(typeof BROWSER_NATIVE_SLASH_COMMANDS)[number], string>> = {
fork: "Create a new fork from a previous message",
};

/**
* Keep the browser palette aligned with omp's own command registry and
* discovery pipeline. Shared text/ACP builtins and every discovered
Expand All @@ -237,14 +246,17 @@ export async function getAvailableSlashCommands(session: AgentSessionLike): Prom
for (const name of BROWSER_NATIVE_SLASH_COMMANDS) {
const builtin = BUILTIN_SLASH_COMMAND_DEFS.find((def) => def.name === name);
if (!builtin) continue;
const browserDescription = BROWSER_NATIVE_DESCRIPTIONS[name];
const hint = builtin.inlineHint;
// A browser-specific description means the registry's subcommands don't apply.
const subcommands = browserDescription ? undefined : builtin.subcommands;
appendSlashCommand(commands, seenNames, {
name: builtin.name,
aliases: builtin.aliases,
description: builtin.description,
description: browserDescription ?? builtin.description,
source: "builtin",
...(hint ? { input: { hint } } : {}),
...(builtin.subcommands ? { subcommands: builtin.subcommands } : {}),
...(subcommands ? { subcommands } : {}),
});
}

Expand Down Expand Up @@ -427,7 +439,10 @@ export class AgentSessionWrapper {
error instanceof Error ? error.message : error,
);
});
this.unsubscribe = this.inner.subscribe((event: AgentEvent) => {
this.unsubscribe = this.inner.subscribe((sessionEvent) => {
// SDK event members are closed interfaces; the browser stream treats them
// as open records (omp 18.10's cache_warming_* events made that explicit).
const event = sessionEvent as unknown as AgentEvent;
if (event.type === "agent_end") {
invalidateSessionListCache();
}
Expand Down
3 changes: 3 additions & 0 deletions lib/slash-command-discovery.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ test("advertises browser-native fork and SDK handoff with canonical metadata", a

assert.equal(byName.get("fork")?.source, "builtin");
assert.equal(byName.get("fork")?.description, "Create a new fork from a previous message");
// omp's pane/window/tab placements open a terminal multiplexer; the browser
// fork has nowhere to put them, so they are not advertised.
assert.equal(byName.get("fork")?.subcommands, undefined);
// omp 18 gave /handoff a shared SDK handler, so it reaches the palette
// through discovery — with the registry's ACP description — rather than the
// browser-native injection /fork still needs.
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "omp-web",
"version": "0.4.4",
"version": "0.5.0",
"description": "Web view for the omp (oh-my-pi) coding agent CLI",
"homepage": "https://github.com/ddallabenetta/omp-web#readme",
"repository": {
Expand Down Expand Up @@ -52,11 +52,11 @@
"tauri": "tauri"
},
"dependencies": {
"@oh-my-pi/pi-agent-core": "~18.3.2",
"@oh-my-pi/pi-ai": "~18.3.2",
"@oh-my-pi/pi-coding-agent": "~18.3.2",
"@oh-my-pi/pi-tui": "~18.3.2",
"@oh-my-pi/pi-utils": "~18.3.2",
"@oh-my-pi/pi-agent-core": "~18.10.4",
"@oh-my-pi/pi-ai": "~18.10.4",
"@oh-my-pi/pi-coding-agent": "~18.10.4",
"@oh-my-pi/pi-tui": "~18.10.4",
"@oh-my-pi/pi-utils": "~18.10.4",
"js-yaml": "^5.4.1",
"next": "16.2.12",
"proper-lockfile": "4.1.2",
Expand Down
Loading