feat(artifact-presenter): open text files in Orca

This commit is contained in:
jb
2026-09-02 21:07:07 -04:00
parent 9e1d59fdee
commit a11ca1743c
4 changed files with 155 additions and 14 deletions
+8 -6
View File
@@ -1,6 +1,6 @@
---
name: artifact-presenter
description: Present local artifacts for review: use Browser Harness for interactive web artifacts, especially HTML, and mcat for non-web files, Markdown, and static source.
description: Present local artifacts for review: use Browser Harness for interactive web artifacts, Orca for editor-friendly text in Orca-managed sessions, and mcat for other non-web files.
---
# Artifact presenter
@@ -26,7 +26,7 @@ Keep ordinary explanations, code diffs, logs, multi-file comparisons, and user-r
Choose the presentation path:
- **Interactive web artifacts, especially `.html`:** use the Browser Harness/Browser Use-backed workflow.
- **Non-web files, Markdown, and static source:** use mcat in the reusable Herdr pane.
- **Non-web artifacts:** run this skill's presenter helper. It opens editor-friendly UTF-8 text directly in Orca when the harness is running in an Orca-managed terminal; otherwise it uses mcat in the reusable Herdr pane. Binary and media files stay on the mcat path.
Completion criterion: select exactly one existing or generated artifact path before presentation.
@@ -46,7 +46,7 @@ Load and follow the [`browser-harness`](../browser-harness/SKILL.md) skill. Open
Completion criterion: the active browser target reports the local artifact URL and page title.
## Present non-web artifacts with mcat
## Present non-web artifacts
Run the helper using its absolute path resolved from this skill directory:
@@ -54,9 +54,11 @@ Run the helper using its absolute path resolved from this skill directory:
python3 <skill-directory>/scripts/present.py <artifact-path>
```
The helper reuses the pane labeled `artifact presenter` in the current Herdr workspace. It serializes pane discovery, creation, and replacement per workspace, with an additional per-pane lock during viewer handoff. When that pane is already displaying an artifact, it closes the active `mcat` viewer and waits for the pane shell before launching the replacement through a shell-neutral helper command with encoded path arguments. It confirms the helper started the viewer rather than trusting terminal input delivery alone. It leaves unrelated foreground programs untouched and creates a new viewer pane instead. When no reusable pane exists, it creates a right split without taking focus. It launches `mcat <artifact-path>` so mcat can infer and display documents, source, archives, PDFs, images, and videos. It falls back to artifact-only delivery when Herdr or mcat is unavailable.
The helper detects an Orca-managed harness from Orca's terminal environment markers (`TERM_PROGRAM=Orca` or scoped `ORCA_*` workspace, worktree, pane, or terminal IDs). For editor-friendly UTF-8 text, it resolves the session's version-appropriate CLI and runs `orca file open <artifact-path> --json`. Orca only opens paths inside its selected worktree, so a rejected path falls through to the normal non-web fallback.
Completion criterion: capture whether the helper opened, reused, or skipped the viewer pane.
The fallback reuses the pane labeled `artifact presenter` in the current Herdr workspace. It serializes pane discovery, creation, and replacement per workspace, with an additional per-pane lock during viewer handoff. When that pane is already displaying an artifact, it closes the active `mcat` viewer and waits for the pane shell before launching the replacement through a shell-neutral helper command with encoded path arguments. It confirms the helper started the viewer rather than trusting terminal input delivery alone. It leaves unrelated foreground programs untouched and creates a new viewer pane instead. When no reusable pane exists, it creates a right split without taking focus. It launches `mcat <artifact-path>` so mcat can infer and display documents, source, archives, PDFs, images, and videos. It falls back to artifact-only delivery when neither Orca nor the Herdr/mcat path can present the file.
Completion criterion: capture whether Orca opened the file, the helper opened or reused an mcat pane, or presentation fell back to the artifact path only.
## Convert only when requested
@@ -77,6 +79,6 @@ Return:
- a one- to three-sentence result summary;
- the artifact path;
- for interactive web artifacts, that Browser Harness presented the artifact and verified its URL/title;
- for other artifacts, whether the reusable mcat pane was opened or reused, or why presentation fell back to the file only.
- for other artifacts, whether Orca opened the file, the reusable mcat pane was opened or reused, or why presentation fell back to the file only.
Do not repeat the complete artifact in chat. Honor a later request to paste any section inline.