open-design/apps/web/tests/components
lefarcen c617e30e27
fix(plugins): make Publish repo actually create the author's repo (#2332) (#2363)
* fix(plugins): make Publish repo actually create the author's repo (#2332)

QA repro from 0.8.0 preview: clicking "Publish repo" on a generated
plugin's `DesignFilesPanel` card ran the agent down a path that
produced an Open Design registry-submission URL but never created the
author's GitHub repo. After the action finished, `gh repo view
nuomi/cat` still returned 404 and `git ls-remote
https://github.com/nuomi/cat.git HEAD` failed with "Repository not
found".

Root cause is the action prompt at
`apps/web/src/components/design-files/pluginFolderActions.ts:11-12`:

  publish: 'Use the supported `od plugin publish` or
            repository-publish flow after confirming the manifest.'

That sentence let the agent pick the legacy registry-link CLI (`od
plugin publish --to open-design`), which mirrors the path the
"Open Design PR" button takes and emits an issue URL instead of
creating a public repo. The button label said "Publish repo" but the
behavior collapsed onto the registry-submission flow.

This PR rewrites the `publish` prompt in the same shape PR #2182
used for `contribute` — a numbered gh + git sequence that drives the
real action end-to-end:

  1. Pre-flight `gh --version` / `gh auth status`. Invalid / expired
     tokens are treated the same as not-logged-in (the bug-report
     agent kept going past an "invalid token" warning).
  2. Read manifest, capture `name`, `version`, `description`,
     `plugin.repo`. Fall back to `https://github.com/<gh-login>/<name>`
     when `plugin.repo` is missing and write it back into the
     manifest.
  3. `gh repo view <owner>/<name>` to decide create-vs-update.
  4a. Repo does not exist → `git init` + commit + tag +
      `gh repo create <owner>/<name> --public --source . --push`.
  4b. Repo exists → reuse the remote, `git add -A` + `git commit -m
      "Update: <name> v<version>"` (skip if working tree is clean),
      `git tag v<version>` (skip if already published), `git push`.
  5. Verify with `gh repo view <owner>/<name> --json url,nameWithOwner`.
  6. Hand off the resolved `https://github.com/<owner>/<name>` URL to
     chat. End the turn.

Hard constraints encoded in the prompt:

* Do NOT call `od plugin publish --to open-design` (or any `--to
  <catalog>` variant). That is the registry-submission flow.
* Do NOT call `AskUserQuestion` — fire-and-forget, same as the
  `contribute` flow's stall fix.
* Do NOT auto-install gh/git. Detect-and-instruct only.
* Do NOT force-push or overwrite a published tag.
* Do NOT retry a failed step. Report and stop.

Refactor: pulled `publish` out of the shared `ACTION_TITLES`/
`ACTION_NOTES` template into its own `buildPublishPrompt(folderPath)`
function (mirrors `buildContributePrompt` from PR #2182). `install`
keeps the simple shared template — that action stays inferrable from
the manifest and doesn't need the same blast radius.

Tests:

* `apps/web/tests/components/pluginFolderActions.test.ts` — extends
  the existing contract suite with seven new `publish` assertions:
  targets `plugin.repo` not the registry catalog, drives the full gh
  + git command list, handles both new-repo and existing-repo
  branches, explicit ban on the registry-submission CLI, hard-bans on
  AskUserQuestion / auto-install / force-push / retry, "invalid
  token" treated as STOP, `${folderPath}` interpolation guard, ends
  by handing the repo URL back to chat.

Validation:

* `pnpm --filter @open-design/web exec vitest run tests/components/pluginFolderActions.test.ts`
  → 16/16 passed (was 9/9 before this PR; +7 new publish-flow
  assertions, the old generic "mentions od plugin publish" assertion
  replaced with the precise contract above)

(Local `pnpm --filter @open-design/web typecheck` fails on
`tests/runtime/exports.test.ts` because `packages/host/dist/testing`
isn't built in this checkout — pre-existing breakage from
`2c128e0e refactor desktop host bridge` on main, unrelated to this
prompt change. CI runs a fresh install and was green on the four
previous prompt-only PRs that touched the same module.)

Closes #2332.

* fix(plugins): don't assume standalone jq when reading the manifest

QA repro from the Open Design PR button (transcript shared with the
PR #2363 thread): the agent reached step 2 of the contribute prompt,
ran `jq '{name,title,description,version}' generated-plugin/open-design.json`,
got `zsh:1: command not found: jq`, and stopped per the prompt's
"stop on first hard failure" rule. No fork, no branch, no PR.

jq is not part of the OD agent runtime baseline — default macOS and
Windows shells don't ship it. The agent reached for it first because
"jq" is the default JSON tool in claude/codex's shell training
distribution, not because the prompt asked for it. The prompt just
said "Load and capture", which the agent interpreted as "shell out to
the most common JSON parser".

Updates both step-2 instructions (contribute + publish prompts) to:

  - List portable manifest-read alternatives in priority order:
    the built-in Read tool (always available); `cat` + manual JSON
    parsing; `node -e 'JSON.parse(...)'` as the shell-only fallback.
  - Add an explicit "Do not assume the standalone `jq` binary is
    installed" guard with the macOS / Windows shell rationale.
  - Disambiguate the standalone `jq` CLI from `gh ... --jq`. The gh
    flag uses an embedded library and is fine — without the
    disambiguation the agent reads the ban literally and stops using
    `gh api user --jq .login` at step 3.

Tests:

* `apps/web/tests/components/pluginFolderActions.test.ts` — two new
  contract assertions:
  - publish prompt: warns against assuming standalone jq is
    installed; lists cat and node -e as alternatives. Closes the
    regression on its own surface.
  - shared block: both contribute and publish prompts disambiguate
    standalone jq from `gh ... --jq`. One assertion guards both
    flows so a future prose edit can't drop the carve-out on one
    side.

Validation:

* `pnpm --filter @open-design/web exec vitest run tests/components/pluginFolderActions.test.ts`
  → 18/18 passed (was 16/16 on the previous PR #2363 commit; +2 new
  jq-guidance assertions)

Continues PR #2363. Same source-of-bug shape as the registry-submission
fallback issue this PR was opened to fix: agent picks a tool the
prompt didn't actually ask for because the prompt was loose.
2026-05-20 15:38:29 +08:00
..
Theater test(web): Critique Theater Phase 13 (reducer p99 bench + surface coverage walker) (#1318) 2026-05-14 15:55:36 +08:00
AgentIcon.test.tsx Fix Kimi CLI icon contrast in light mode (#1667) 2026-05-14 20:32:52 +08:00
App.connectors.test.tsx feat(privacy): collapse first-run consent banner to a single "I get it" button (#2202) 2026-05-19 15:26:56 +08:00
App.mediaProviders.test.tsx [codex] Add global onboarding flow without AMR (#2272) 2026-05-19 22:00:40 +08:00
assistant-message-tool-status.test.tsx fix(web): complete finished tool calls missing results (#1240) 2026-05-11 15:54:11 +08:00
assistant-message-unfinished-todos.test.tsx Garnet hemisphere (#1769) 2026-05-15 14:42:11 +08:00
AssistantMessage.test.ts chore: enforce test directory conventions (#496) 2026-05-05 15:34:22 +08:00
AssistantMessage.test.tsx Revert "fix(web): restore consistent app header layout (#1432)" 2026-05-13 11:20:16 +08:00
auto-open-file.test.ts chore: enforce test directory conventions (#496) 2026-05-05 15:34:22 +08:00
BoardComposerPopover.pod-chip-hover.test.tsx feat(web): highlight captured Pod component on chip hover (#1982) 2026-05-18 16:34:19 +08:00
BoardComposerPopover.pod-remove.test.tsx feat(web): add manual removal for captured Pod components (#1951) 2026-05-17 20:13:56 +08:00
chat-feedback.test.tsx fix(web): auto-scroll feedback form (#1566) 2026-05-13 19:06:08 +08:00
chat-scroll-preservation.test.tsx fix(web): keep chat pinned during content growth (#1716) 2026-05-15 14:12:00 +08:00
ChatComposer.context-pickers.test.tsx [codex] Add automation templates and proposal workflows (#2193) 2026-05-19 16:35:28 +08:00
ChatComposer.infinite-render.test.tsx fix(web): stop re-syncing composer scroll on every keystroke (#2282) 2026-05-20 11:15:59 +08:00
ChatComposer.search.test.tsx Garnet hemisphere (#1769) 2026-05-15 14:42:11 +08:00
ChatPane.resume-conversation.test.tsx feat(web): "Resume conversation in new chat" UI — #462 Commit B (companion to #1718) (#2264) 2026-05-20 13:28:27 +08:00
ChatPane.streaming.test.tsx fix: stop stale pinned todos after terminal runs (#2321) 2026-05-20 11:13:20 +08:00
CommentTargetOverlay.hover-class.test.tsx feat(web): highlight captured Pod component on chip hover (#1982) 2026-05-18 16:34:19 +08:00
ConnectorsBrowser.test.tsx Add connector memory extraction flow (#2265) 2026-05-19 21:27:41 +08:00
ContinueInCliButton.test.tsx feat(web): add Finalize design package + Continue in CLI buttons (#451) (#974) 2026-05-10 11:44:32 +08:00
conversation-timestamps.test.tsx fix(web): freeze completed run durations across conversations (#1351) 2026-05-14 14:25:37 +08:00
CustomSelect.test.tsx feat(web): add custom select primitive (#1714) 2026-05-15 14:43:18 +08:00
DesignFilesPanel.test.tsx Polish project workspace UI (#2201) 2026-05-19 15:14:16 +08:00
DesignsTab.select-mode.test.tsx feat(web): redesign Designs tab cards — covers, tags, overflow menu, multi-select (#1161) 2026-05-12 15:08:22 +08:00
DesignsTab.test.ts chore: enforce test directory conventions (#496) 2026-05-05 15:34:22 +08:00
DesignSystemFlow.test.tsx [codex] Add global onboarding flow without AMR (#2272) 2026-05-19 22:00:40 +08:00
DesignSystemsTab.test.tsx fix(web): scope design-systems surface chip counts to active style filter (#2141) 2026-05-19 23:42:45 +08:00
EntryView.test.ts Add connector memory extraction flow (#2265) 2026-05-19 21:27:41 +08:00
examples-tab-filter-counts.test.tsx fix: keep examples filter counts consistent (#949) 2026-05-08 21:41:52 +08:00
examples-tab-preview-dispatch.test.tsx fix(web): dispatch Examples preview on od.preview.type (#897) (#1001) 2026-05-09 21:32:45 +08:00
examples-tab-retry.test.tsx fix(web): dispatch Examples preview on od.preview.type (#897) (#1001) 2026-05-09 21:32:45 +08:00
ExamplesTab.test.tsx test: expand entry and settings automation coverage (#954) 2026-05-11 10:49:42 +08:00
file-viewer-markdown-copy.test.tsx feat(analytics): add project_id + project_kind to studio/artifact events (#1509) 2026-05-13 12:13:55 +08:00
file-viewer-render-mode.test.ts Prevent imported Claude canvases from zooming on scroll (#1726) 2026-05-15 16:37:57 +08:00
FileOpsSummary.test.tsx feat(web): implement file operations summary in assistant messages 2026-05-11 23:25:38 +08:00
FileViewer.manual-edit-history.test.tsx fix(web): align Icon names and FileViewer tests with merged state 2026-05-13 18:40:48 +08:00
FileViewer.manual-edit.test.tsx fix(web): align Icon names and FileViewer tests with merged state 2026-05-13 18:40:48 +08:00
FileViewer.test.tsx fix(web): rename FileViewer Share button label to Export (#2233) 2026-05-20 15:22:32 +08:00
FileWorkspace.design-system.test.tsx [codex] Land design system GitHub intake handoff (#2187) 2026-05-19 14:30:17 +08:00
FileWorkspace.test.tsx Garnet hemisphere (#1702) 2026-05-14 21:12:50 +08:00
GenUISurfaceRenderer.diff-review.test.tsx feat(web): native diff-review UI on GenUISurfaceRenderer (Phase 8 entry slice) 2026-05-09 15:36:38 +00:00
GenUISurfaceRenderer.schema-form.test.tsx feat(daemon): enrich API responses with surface specs and add new flags 2026-05-11 20:27:05 +08:00
GenUISurfaceRenderer.test.tsx feat(web): plugin composer surface — applyPlugin + Rail + Inputs + GenUI renderer 2026-05-09 11:47:12 +00:00
HomeHero.plugin-picker.test.tsx Revert "fix(web): demote Plugins and Integrations to nav rail footer (#1806)" (#2360) 2026-05-20 12:43:49 +08:00
HomeHero.rail.test.tsx Revert "fix(web): demote Plugins and Integrations to nav rail footer (#1806)" (#2360) 2026-05-20 12:43:49 +08:00
HomeView.context-picker.test.tsx Garnet hemisphere (#1769) 2026-05-15 14:42:11 +08:00
HomeView.media-options.test.tsx Implement Home audio essential workflow (#2104) 2026-05-18 23:14:03 +08:00
HomeView.plugin-i18n.test.tsx Garnet hemisphere (#1702) 2026-05-14 21:12:50 +08:00
HomeView.prefill.test.tsx Revert "fix(web): demote Plugins and Integrations to nav rail footer (#1806)" (#2360) 2026-05-20 12:43:49 +08:00
InlinePluginsRail.test.tsx feat(web): enhance PluginLoopHome with plugin details modal and refined plugin rail 2026-05-11 23:18:34 +08:00
ManualEditPanel.test.tsx chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
MarketplaceView.test.tsx feat(web): MarketplaceView + PluginDetailView + /marketplace routes 2026-05-09 12:28:59 +00:00
McpClientSection.oauth.test.tsx fix(mcp): support no-auth local HTTP servers (#2008) 2026-05-18 17:08:46 +08:00
McpJsonHelper.test.tsx feat: add collapsible MCP JSON field-mapping helper (#1136) 2026-05-10 19:37:46 +08:00
MemorySection.test.tsx Add connector memory extraction flow (#2265) 2026-05-19 21:27:41 +08:00
modelOptions.test.tsx test: cover model option rendering (#948) 2026-05-08 21:38:13 +08:00
NewAutomationModal.context-picker.test.tsx [codex] Add automation templates and proposal workflows (#2193) 2026-05-19 16:35:28 +08:00
NewProjectModal.test.tsx fix(web): confirm before deleting saved template in New Project (#2330) 2026-05-20 14:50:36 +08:00
NewProjectPanel.media.test.tsx Revert "fix(web): restore consistent app header layout (#1432)" 2026-05-13 11:20:16 +08:00
NewProjectPanel.test.ts feat(audio): add ElevenLabs audio support (#1384) 2026-05-13 15:53:41 +08:00
NewProjectPanel.test.tsx fix(web): confirm before deleting saved template in New Project (#2330) 2026-05-20 14:50:36 +08:00
pet-task-center.test.ts [codex] Add pet task center and desktop pet (#1833) 2026-05-19 15:38:39 +08:00
PetOverlay.test.tsx [codex] Add pet task center and desktop pet (#1833) 2026-05-19 15:38:39 +08:00
PluginDetailsModal.dispatch.test.tsx feat(web): standardize plugin terminology and enhance UI components 2026-05-13 12:19:29 +08:00
pluginFolderActions.test.ts fix(plugins): make Publish repo actually create the author's repo (#2332) (#2363) 2026-05-20 15:38:29 +08:00
PluginInputsForm.test.tsx chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
plugins-home-facets.test.ts feat(daemon, web): enhance plugin preview handling and add new templates 2026-05-13 20:58:24 +08:00
plugins-home-html-surface.test.tsx feat(daemon): enhance plugin preview handling and add fallback mechanisms 2026-05-12 16:45:24 +08:00
plugins-home-preview.test.ts feat(web): enhance TasksView and plugin preview components with new features and styles 2026-05-12 18:10:37 +08:00
plugins-home-section.test.tsx feat(plugins): add login and whoami commands for GitHub CLI authentication 2026-05-14 07:25:05 +08:00
plugins-home-visualScore.test.ts feat(plugins): enhance visual score sorting and add new example templates 2026-05-13 21:02:05 +08:00
PluginShareMenu.test.tsx feat(plugins): add login and whoami commands for GitHub CLI authentication 2026-05-14 07:25:05 +08:00
PluginsSection.test.tsx feat(web): redesign entry view with new navigation and home layout 2026-05-12 10:56:35 +08:00
PluginsView.test.tsx Revert "fix(web): demote Plugins and Integrations to nav rail footer (#1806)" (#2360) 2026-05-20 12:43:49 +08:00
preview-modal-error-state.test.tsx fix(web): show explicit error/retry state when example preview HTML fails to load (#863) 2026-05-08 11:16:14 +08:00
preview-modal-fullscreen.test.tsx test(e2e): gate beta packaged runtime (#637) 2026-05-06 17:44:29 +08:00
preview-modal-unavailable-state.test.tsx fix(web): dispatch Examples preview on od.preview.type (#897) (#1001) 2026-05-09 21:32:45 +08:00
PreviewDrawOverlay.test.tsx fix(web): keep draw overlay scrollable (#1848) 2026-05-15 23:05:49 +08:00
PreviewModal.test.tsx fix: fix link handling in example preview iframe sandbox (#701) 2026-05-09 21:24:25 +08:00
PrivacyConsentModal.test.tsx feat(privacy): collapse first-run consent banner to a single "I get it" button (#2202) 2026-05-19 15:26:56 +08:00
PrivacySection.test.tsx feat: add opt-in Langfuse telemetry (#800) 2026-05-09 10:06:01 +08:00
ProjectView.api-empty-response.test.tsx Fix daemon run recovery across reloads (#2374) 2026-05-20 15:10:23 +08:00
ProjectView.deleteConversation.test.tsx Fix daemon run recovery across reloads (#2374) 2026-05-20 15:10:23 +08:00
ProjectView.pendingPrompt.test.tsx Fix daemon run recovery across reloads (#2374) 2026-05-20 15:10:23 +08:00
ProjectView.projectInstructions.test.tsx Fix daemon run recovery across reloads (#2374) 2026-05-20 15:10:23 +08:00
ProjectView.resume-conversation.test.tsx Fix daemon run recovery across reloads (#2374) 2026-05-20 15:10:23 +08:00
ProjectView.run-cleanup.test.tsx Fix daemon run recovery across reloads (#2374) 2026-05-20 15:10:23 +08:00
ProjectView.run-isolation.test.tsx Fix daemon run recovery across reloads (#2374) 2026-05-20 15:10:23 +08:00
ProjectView.tabs-navigation.test.tsx Fix daemon run recovery across reloads (#2374) 2026-05-20 15:10:23 +08:00
QuestionForm.test.tsx feat(audio): add ElevenLabs audio support (#1384) 2026-05-13 15:53:41 +08:00
QuickSwitcher.test.tsx feat(web): add Cmd/Ctrl+P quick file switcher (#556) 2026-05-06 10:31:50 +08:00
RoutinesSection.test.tsx [codex] Add automation templates and proposal workflows (#2193) 2026-05-19 16:35:28 +08:00
SettingsDialog.execution.test.tsx fix(web): rename FileViewer Share button label to Export (#2233) 2026-05-20 15:22:32 +08:00
SettingsDialog.media.test.tsx refactor(web): rename Execution mode and tighten settings dialog UI (#1568) 2026-05-15 14:35:06 +08:00
SettingsDialog.orbit.test.tsx chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
SettingsDialog.test.ts [codex] Add Cursor Agent auth diagnostics (#1538) 2026-05-13 20:25:34 +08:00
sketch-model.test.ts fix(web): render static previews for sketch json files (#1060) 2026-05-11 19:29:46 +08:00
SkillsSection.test.tsx fix(web): warn before editing a built-in skill creates a shadow (#1850) 2026-05-17 18:30:45 +08:00
TasksView.history.test.tsx [codex] Add automation templates and proposal workflows (#2193) 2026-05-19 16:35:28 +08:00
TasksView.templates.test.tsx [codex] Add automation templates and proposal workflows (#2193) 2026-05-19 16:35:28 +08:00
Toast.test.tsx feat(web): add Finalize design package + Continue in CLI buttons (#451) (#974) 2026-05-10 11:44:32 +08:00
TrustBadge.test.tsx feat(web): unify plugin trust badges (#2088) 2026-05-18 19:20:01 +08:00
UpdaterPopup.test.tsx feat: add windows packaged auto update flow (#2362) 2026-05-20 12:56:14 +08:00
use-everywhere-agent-guide.test.ts feat(web): enhance entry view with responsive topbar and GitHub star integration 2026-05-12 11:57:41 +08:00
WorkspaceTabsBar.test.tsx Garnet hemisphere (#1769) 2026-05-15 14:42:11 +08:00