31 Commits

Author SHA1 Message Date
hzliangzhi 316c118680 fix(collab-web): render the user-added note in ask tool cards
The ask tool stores the user-attached note in result details (note on the
single-question shape, per-item note inside results[]), but the shared
tool renderer dropped it: AskAnswer carried no note field and the card
never rendered one. Extract and render it as a muted row so HTML exports
and the collab guest view keep the user's context.
2026-08-17 11:55:26 +08:00
robomp-bot a2b7a4c8ad Merge remote-tracking branch 'upstream/main' into fix/collab-web-liveness-state 2026-07-30 08:06:32 +09:00
robomp-bot a54b11f4c3 fix(collab-web): surface terminal auto_retry_end failures
(cherry picked from commit 6a6c4014158d9636ed0e030837633ad313c1aa5a)
2026-07-29 23:08:53 +02:00
robomp-bot 12d0363b75 fix(collab-web): make host state authoritative for guest liveness 2026-07-29 18:41:36 +09:00
roboomp 839ba1ce02 fix(collab-web): restore resolve/reject/propose cards after xdev unwrap
After the resolve tool became xd:// devices, ToolView.executeXdevDispatch
unwraps xd://resolve/reject/propose writes so the card model lives on the
unwrapped inner details and the device name, but tools/resolve.tsx still
read action/reason from args, rendering a "?"/warn badge. The renderer now
derives the card kind (apply/discard/propose) from inner details first,
falling back to args and to the device-name default for running cards, and
surfaces propose plan metadata. registry.ts also registers reject/propose
and the historical hub-family aliases (irc, job, await, poll, cancel_job)
so those transcript names stop falling back to generic JSON.

Fixes #5640
2026-07-23 19:23:27 +00:00
roboomp 27df758721 fix(collab-web): guard composer submit against IME composition
Both onKeyDown handlers in Composer.tsx committed on Enter without checking
IME composition state, so confirming a Korean/Japanese/Chinese composition
with Enter re-committed the composing character (한글 -> 한글글).

Extract a shouldSubmitOnEnter predicate that returns false while
nativeEvent.isComposing or a composing ref is set, and a useCompositionGuard
hook that tracks compositionstart/compositionend with a deferred reset for
the WebKit case where the confirming Enter keydown fires after
compositionend. Wire both AskEditor and Composer to it.

Fixes #6163
2026-07-21 21:48:53 +00:00
can1357 8485309ff9 merged PR #5560: fix(collab-web): render user and host messages as markdown 2026-07-16 03:31:54 +02:00
can1357 5ff277349c refactor(coding-agent): consolidated tool surface onto xd:// devices and hub
- Added the `xd://` virtual device protocol (`internal-urls/xd-protocol.ts`, `tools/xdev.ts`): tools declaring `loadMode: "discoverable"` are unmounted from the request tools array and driven via `read xd://` (list/docs+schema) and `write xd://<tool>` (execute), gated by the `tools.xdev` setting (default on) and inlined into the system prompt.
- Merged the `irc`, `job`, and `launch` tools into a single `hub` tool (`tools/hub/`, `async/job-manager.ts`): messaging keeps `send`/`inbox`/`list`, job control maps to `wait`/`cancel`/`jobs`, process supervision keeps `start`/`logs`/`stop`/`restart`/`describe` with `ps`, and the unified `wait` races background jobs against peer messages; SDK `IrcTool`/`JobTool`/`LaunchTool` are replaced by `HubTool`.
- Removed the hidden `resolve` tool in favor of the `xd://resolve`/`xd://reject`/`xd://propose` resolution devices, auto-including `write` whenever a deferrable tool or plan mode is present.
- Removed the BM25 tool-discovery system: the `search_tool_bm25` tool, the `tool-discovery` module, the `tools.discoveryMode`/`mcp.discoveryMode`/`mcp.discoveryDefaultServers`/`tools.essentialOverride` settings, per-tool MCP selection, and the `mcp_tool_selection` message type.
- Unified tool presentation on `ToolLoadMode` (`essential`|`discoverable`), replacing the custom-tool `xdev?: boolean` opt-out; custom, extension, MCP, RPC host, image-generation, and TTS tools now default to `discoverable`, and added a `satisfies` predicate to `SoftToolRequirement`.
- Removed the standalone `ssh` command tool and `ssh/ssh-executor` (the `ssh://` read/write/search protocol stays), and made `--tools` address hidden built-ins.
- Updated collab-web to render `xd://` dispatches and `hub` op families, dropped the `search_tool_bm25`/`ssh`/`report-finding` renderers, refreshed tool docs and prompts, and migrated the affected tests and changelogs.
2026-07-15 15:16:29 +02:00
roboomp 707046b689 fix(collab-web): rendered transcript messages as markdown
- Routed user and custom message text through the sanitized Markdown renderer.
- Increased spacing between adjacent assistant content blocks.
- Added host and guest Markdown regression coverage.

Fixes #5559
2026-07-15 09:34:36 +00:00
roboomp 8480a84b3c fix(collab-web): preserve active transcript args
- Render deduped active tool cards with the execution args carried by ActiveTool.
- Covered differing raw assistant args and effective active args in the transcript regression test.

Fixes #4948
2026-07-09 17:04:32 +00:00
roboomp 70316a7f8b fix(collab-web): dedup active transcript tools
- Dedup active tools against committed assistant tool calls as well as the stream ghost.
- Hide the working shimmer while active tools are rendering, preserving it for between-tool model work.
- Added focused Transcript regression coverage for duplicate cards and stale shimmer.

Fixes #4948
2026-07-09 16:47:24 +00:00
can1357 e7be361148 fix(collab): isolated editor state to preserve draft input
- Extracted `AskEditor` into a standalone, key-bound component keyed by `reqId`.
- Preserved user-typed draft state across duplicate incoming host requests of the same ID.
- Reset the editor draft state only when a genuinely new request ID arrives.
- Simplified `Composer` autosizing logic and state orchestration by isolating editor-specific hooks.
- Adjusted integration tests to match HTML structure changes of the submit action.
2026-07-02 02:40:08 +02:00
can1357 22bfccfda8 fix(collab-web): terminated guest connections immediately on pre-welcome errors
- Prevents connection hangs during initial join by immediately failing when a host rejects a guest prior to welcome.
- Short-circuits the connection welcome timeout upon receiving a pre-welcome error frame.
- Surfaces exact protocol mismatch and hello rejection reasons directly to the joining guest interface.
- Ensures `CollabGuestLink` and `GuestClient` transition immediately to ended/failed states with host error details.
2026-07-02 01:51:09 +02:00
can1357 321e023d60 fix(collab-web): surfaced terminal transcript errors instead of hot-retrying
- fetchTranscript returns a typed rows/error union; terminal frame errors stop AgentDrawer polling and render below already-loaded rows via the extracted decideTranscriptPoll helper.
2026-07-02 00:33:05 +02:00
can1357 09dc1f0139 fix(collab): handle pending guest ui requests 2026-07-01 21:53:00 +02:00
roboomp 6efdd000f0 fix(collab): preserved editor ask responses verbatim
Dropped trim and empty gating in the collab web composer so custom ask editor responses ship exactly what the user typed, matching HookEditor's local submit.
2026-07-01 05:22:47 +00:00
roboomp 9d3918bdac fix(collab): enabled mobile ask responses
Routed host UI requests through writable collab web guests and added mobile response controls for ask questions.

Fixes #4035
2026-07-01 05:15:37 +00:00
roboomp c58cef161b fix(collab): hid advisory tags in transcript markdown
Stripped advisory wrapper tags in the collab web Markdown renderer while preserving escaped advisory content and existing raw HTML escaping.

Added a regression test for assistant advisory blocks in the collab transcript renderer and documented the fix in the collab-web changelog.

Fixes #3559
2026-06-26 10:51:42 +00:00
can1357 c31e7fc16e Merge PR #3145: fix(collab): chunked welcome so large session snapshots can join (@roboomp) 2026-06-20 22:12:47 +02:00
roboomp 459fb10441 fix(collab-web): time out stalled snapshot chunks
The web guest cleared the welcome timeout as soon as metadata arrived,
but non-empty snapshots had no replacement progress clock while waiting
for snapshot-chunk.final. If the relay stalled after welcome or after a
partial chunk, the client stayed stuck in its loading phase forever.

Mirror the TUI guest's snapshot progress timeout: arm it for non-empty
welcome frames, reset it on each non-final chunk, clear it on final and
on close/end, and end the web session with the same session-snapshot
timeout reason when no chunk progress arrives.

Fixes #3144
2026-06-20 18:52:50 +00:00
roboomp 5b937511c4 fix(collab): chunked welcome so large session snapshots can join
The host used to ship the entire transcript inside a single welcome
frame, so a multi-MB session spent the guest's 30s first-welcome
timeout on the relay transfer itself: ~1.3 MB took ~3s, ~4.2 MB took
~12s, and ~13.6 MB never arrived before the guest gave up with
'timed out waiting for the host's welcome'.

Bump COLLAB_PROTO to 2 and split the welcome:

- welcome carries metadata only (header, state, agents, entryCount,
  readOnly) and lands in well under one second.
- a train of snapshot-chunk frames (SNAPSHOT_CHUNK_BYTES = 512 KB,
  oversize entries ship alone) carries the transcript. Last chunk
  flips final: true; an empty snapshot still emits one final chunk.
- the host queues welcome + chunks synchronously inside #handleHello,
  preserving the host comment's ordering invariant (later broadcast
  frames cannot interleave between them).
- the TUI guest accumulates chunks under a SNAPSHOT_PROGRESS_TIMEOUT_MS
  that resets per chunk; only after final does it write the replica
  jsonl, switchSession, and render. The first-welcome timeout still
  guards arrival of the small welcome.
- the collab-web GuestClient streams entries into the snapshot as
  chunks arrive and flips phase to 'live' on final.

Includes a contract test (in-process relay) asserting the welcome is
metadata-only, the chunk train fans the 1.5 MB synthetic transcript
across multiple frames with only the last marked final, and the
flattened entries match the source snapshot.

Fixes #3144
2026-06-20 18:33:59 +00:00
can1357 571eb5c4db fix(tui): cleaned up markdown rendering of inline tags and entities
- Stripped `<span>` and `<text>` tags from rendered markdown while preserving their contents.
- Updated HTML entity normalization to handle common special characters and numeric codes within the TUI.
- Ensured whitespace surrounding stripped inline tags is preserved, preventing content merging.
2026-06-20 08:11:31 +02:00
Bin Jin e91d2cc776 feat(collab): added QR links and split web UI URL support
- Added collab.webUrl and rendered browser links as web UI wrappers whose fragments carry relay links.
- Added one-shot /collab qrcode and /collab qrcode-view commands with terminal QR rendering.
- Updated coding-agent and collab-web parsers to prefer parseable wrapper fragments while preserving legacy links.
- Added regression tests and changelog entries for split-host collab links and QR commands.
2026-06-19 01:21:21 +02:00
chan1103 d0b754c932 fix(collab-web): align transcript wrapping with TUI 2026-06-16 14:15:29 +09:00
can1357 0d49f94418 fix(collab): switched collab links to dot-joined room secrets
- Changed the link grammar from `<roomId>#<key>` / `host[:port]/r/<roomId>#<key>` to dot-joined `<roomId>.<key>` in `formatCollabLink`/`parseCollabLink` (`packages/coding-agent/src/collab/protocol.ts`) and the collab-web mirror (`packages/collab-web/src/lib/link.ts`): RFC 3986 forbids a raw `#` inside a fragment, so strict URL stacks (macOS Foundation behind terminal click-to-open) percent-encoded the second `#`.
- Kept legacy `#`-joined links parseable via `BARE_LINK_RE` and added lenient `%23` → `#` decoding for mangled deep links.
- Updated the `ConnectScreen` placeholder, `app.tsx` deep-link comment, `DEFAULT_RELAY_URL` doc in `packages/wire`, `docs/collab.md` examples, and both package CHANGELOGs.
- Extended `crypto.test.ts` and `link.test.ts` with dot-joined, legacy-hash, and `%23`-mangled link coverage.
2026-06-12 16:47:56 +02:00
can1357 ca85d9fe69 chore(collab): moved the public relay and share endpoints to my.omp.sh
- Changed `DEFAULT_RELAY_URL` in `@oh-my-pi/pi-wire` from `wss://relay.omp.sh` to `wss://my.omp.sh` and updated the constants, collab-link, and join-command tests asserting the old origin.
- Added `DEFAULT_SHARE_URL` (`https://my.omp.sh/s`) to pi-wire with its changelog entry; it shares a changed run with the relay constant and is consumed by the upcoming /share work.
- Updated collab-web canonical/OG/twitter URLs in `index.html`, `robots.txt`, `sitemap.xml`, README, and the `local-relay.ts` doc comment to the new domain.
- Refreshed the `/collab` entry in the coding-agent changelog to reference the new relay origin.
2026-06-12 14:59:00 +02:00
can1357 a57f5aa1ce test(coding-agent): expanded tests for model scope notification and collab link parsing
- Extended `parseCollabLink` test coverage to reject 16-byte and 40-byte fragments instead of only rejecting short keys.
- Added coverage for full-link fragments to ensure key and write token are parsed when present.
- Updated `GuestClient` test setup so `welcomeFrame` carries a `readOnly` flag into snapshot assertions.
2026-06-12 13:49:59 +02:00
can1357 b16bfbe0f9 feat(collab-web): implemented read-only session controls and refreshed app branding metadata
- Enabled read-only mode by wiring snapshot.readOnly through AgentDrawer and Composer to block prompts and controls.
- Added read-only indicators in the header and participant titles for view-only sessions.
- Added SEO and app metadata assets by updating index.html head tags, manifest, robots.txt, and sitemap.xml.
- Updated brand presentation by adding new favicon/OG assets and switching theme tokens to new OMP colors.
2026-06-12 13:40:12 +02:00
can1357 09aa87103c feat: added read-only and write-token-based collab links for view-only sessions
- Added write-token generation and validation to distinguish writable and read-only guests.
- Added deep-link support using `https://<relay>/#<link>` with 32/48-byte collab secrets.
- Added full-link and key-only semantics where full links grant writes and key-only links are view-only.
- Added /collab view/status/stop command updates with read-only participant status and join hints.
2026-06-12 13:34:43 +02:00
can1357 3866501c88 ux(collab-web): updated shell and agent focus styling and relay test message queueing
- Set chat, composer, and input focus states to use transparent focus-visible outlines with ring border coloring.
- Tuned shell and agent visual tokens including gauge and banner styles.
- Updated relay test WebSocket helpers to queue incoming messages per socket and fetch them through a timeout-aware next-message helper.
2026-06-12 12:03:34 +02:00
can1357 8fa1f6c250 feat: added shared collab wire protocol and web guest collaboration client
- Added @oh-my-pi/pi-wire and reworked collab protocol types into shared contracts.
- Added wire-compatibility guards in coding-agent host to block unsupported events.
- Added standalone collab-web package with guest UI, mock-host tooling, and local relay.
- Added secure room-link validation, WebCrypto framing, and safer socket routing.
2026-06-12 11:54:41 +02:00