From 42df76747bc61dfb5b81130db13444e655f79cf3 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 14 May 2026 01:55:09 +0100 Subject: [PATCH] Remove Codex skill mention plumbing --- notes/fresh-workspace-handoff.md | 10 +- state/ledgers.msgpack | Bin 108169 -> 108532 bytes state/map.yaml | 13 +- .../schema/json/ClientRequest.json | 24 -- .../schema/json/ServerNotification.json | 24 -- .../codex_app_server_protocol.schemas.json | 24 -- .../codex_app_server_protocol.v2.schemas.json | 144 +++---- .../json/v2/ItemCompletedNotification.json | 24 -- .../json/v2/ItemStartedNotification.json | 24 -- .../schema/json/v2/ReviewStartResponse.json | 24 -- .../schema/json/v2/ThreadForkResponse.json | 24 -- .../schema/json/v2/ThreadListResponse.json | 24 -- .../json/v2/ThreadMetadataUpdateResponse.json | 24 -- .../schema/json/v2/ThreadReadResponse.json | 24 -- .../schema/json/v2/ThreadResumeResponse.json | 24 -- .../json/v2/ThreadRollbackResponse.json | 24 -- .../schema/json/v2/ThreadStartResponse.json | 24 -- .../json/v2/ThreadStartedNotification.json | 24 -- .../json/v2/ThreadTurnsListResponse.json | 24 -- .../json/v2/ThreadUnarchiveResponse.json | 24 -- .../json/v2/TurnCompletedNotification.json | 24 -- .../schema/json/v2/TurnStartParams.json | 24 -- .../schema/json/v2/TurnStartResponse.json | 24 -- .../json/v2/TurnStartedNotification.json | 24 -- .../schema/json/v2/TurnSteerParams.json | 24 -- .../schema/typescript/v2/UserInput.ts | 2 +- .../app-server-protocol/src/protocol/v2.rs | 19 +- .../codex-rs/core-skills/src/injection.rs | 47 +-- .../core-skills/src/injection_tests.rs | 66 +-- .../codex/codex-rs/core/src/agent/control.rs | 1 - vendor/codex/codex-rs/protocol/src/models.rs | 2 +- .../codex/codex-rs/protocol/src/user_input.rs | 7 +- .../tui/src/bottom_pane/chat_composer.rs | 288 +------------ .../codex/codex-rs/tui/src/bottom_pane/mod.rs | 84 +--- .../tui/src/bottom_pane/skill_popup.rs | 390 ------------------ ...ll_popup__tests__skill_popup_scrolled.snap | 43 -- vendor/codex/codex-rs/tui/src/chatwidget.rs | 57 +-- .../codex-rs/tui/src/chatwidget/realtime.rs | 4 +- .../codex-rs/tui/src/chatwidget/skills.rs | 252 ----------- .../codex-rs/tui/src/chatwidget/tests.rs | 2 - .../chatwidget/tests/composer_submission.rs | 86 +--- .../tui/src/chatwidget/tests/helpers.rs | 2 - .../tui/src/chatwidget/tests/plan_mode.rs | 2 +- .../tui/src/chatwidget/tests/review_mode.rs | 2 +- vendor/codex/codex-rs/tui/src/lib.rs | 1 - .../codex/codex-rs/tui/src/mention_codec.rs | 23 +- .../codex/codex-rs/tui/src/skills_helpers.rs | 20 - 47 files changed, 108 insertions(+), 1963 deletions(-) delete mode 100644 vendor/codex/codex-rs/tui/src/bottom_pane/skill_popup.rs delete mode 100644 vendor/codex/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__skill_popup__tests__skill_popup_scrolled.snap delete mode 100644 vendor/codex/codex-rs/tui/src/chatwidget/skills.rs delete mode 100644 vendor/codex/codex-rs/tui/src/skills_helpers.rs diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 87467e58..bcfa63c5 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -874,8 +874,7 @@ and lives under MCP server config. The plugin feature and mention residue is gone too. `Feature::Plugins`, `Feature::RemotePlugin`, `plugin://` structured mentions, plugin instruction tags, stale plugin popup snapshots, and app/plugin path classification in -`codex-core-skills` were deleted. Live structured mentions are MCP/skill-shaped -only. Do not resurrect plugin product routing or `app://` compatibility to make +`codex-core-skills` were deleted. Do not resurrect plugin product routing or `app://` compatibility to make old tests feel less lonely; the blessed route is `mcp://` at the MCP edge and typed CultCache/CultNet documents inside Epiphany. @@ -900,6 +899,13 @@ handlers, TUI slash/startup/list/manage-skill surfaces, docs, or test helpers. The fake live-reload/developer-message and skill-list tests were deleted rather than repaired into new compatibility lies. +The live skill mention channel is also gone. `UserInput::Skill`, the app-server +schema branch, TUI skill popup, `skills_all` cache, composer skill mention API, +skill insertion path, `skill://` / `SKILL.md` history decoding, and stale skill +popup snapshot were deleted. Live structured user-input mentions are MCP-shaped +only; MCP remains JSON-RPC at its protocol edge, not a reason to keep Codex +skills alive inside the organ. + That husk has now been cut from `codex-core`. The root core crate no longer exports `plugins`, no longer depends on `codex-core-plugins` or `codex-plugin`, and the core plugin manager / marketplace add-remove-sync modules and tests diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 6f51b007ea6d3d6ff561e2a2287863602371a283..e3181125a14840cf205e9e08da9926a9c9e7faa7 100644 GIT binary patch delta 354 zcmZXQy-EW?6opxfyn@)s1reLw?3y2ou?kj;5yT{gVl$b&WXJ5z3^TJ!tQ54d69PVf z2!fp;1SPK!@-E^7IBu-8J?Gr-+tuG#fC+gO_6pWQ4PYeFNaGO4r%s74q`f%{NS&p$Vg+&oSK iTX1mgY`g-kL?$%`)ujfwxIk8|RRQbQZ~wp5I{OAe3VnY7 delta 49 zcmexzo~`pN+XQ8%W&Rsgr!g|hHt%8FzK4-<`x3E+Ek*`LX1WHZx`rkp1_o9JCRV0K FQ2@!F5AXm0 diff --git a/state/map.yaml b/state/map.yaml index b8557676..6be8c404 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -280,7 +280,7 @@ rejected_paths: reason: making Epiphany cleaner inside Codex still preserves the wrong organ; Codex must be starved down to OpenAI subscription auth/model transport, while Epiphany data and subsystem communication move to typed CultCache/CultNet. current_status: - summary: The Codex starvation pass has five typing receipts, forty-seven processor/foundation cuts, a real physical extraction in `epiphany-codex-bridge`, a root `epiphany-state-model` crate for durable Epiphany state, a source-grounded Codex auth spine inventory, the native `epiphany-openai-adapter` document boundary, a buildable Codex auth/model wrapper in `epiphany-openai-codex-spine`, the first native runtime caller in `epiphany-openai-runtime`, native heartbeat launch planning/job opening in `epiphany-core`, native state-update contract/validation/application in `epiphany-core`, native exact retrieval path matching in `epiphany-core`, and the route-facing mutation/view/coordinator projection services in `epiphany-codex-bridge`. `codex-protocol` no longer defines the durable `Epiphany*` state structs; it re-exports the native model for legacy rollout/API compatibility while `epiphany-core` imports the native model directly. `epiphany-core` now has no direct vendored Codex dependency: pressure derivation accepts native `EpiphanyTokenUsageSnapshot`, Codex rollout replay moved to `codex-core::epiphany_rollout`, and exact retrieval search uses Epiphany-owned workspace walking/path scoring instead of `codex-file-search`. The bridge owns Codex-facing Epiphany adapters for scene, jobs, context/planning/graph query, retrieval/indexing projection, result projection, runtime-spine result adaptation, launch/prompt doctrine, mutation document mechanics, mutation service update/promote/role-accept/reorient-accept/role-launch/reorient-launch/job-launch/job-interrupt application, live-state projection, pressure/pre-compaction rendering, freshness/reorientation projection, CRRC/coordinator/role-board projection, watcher invalidation adaptation, full `thread/epiphany/view` response construction, freshness/context/graph-query response construction, role/reorient result response construction, distill/propose patch-response construction, coordinator status/view construction, and acceptance/evidence signal helpers. Vendored app-server no longer retains root Epiphany modules; `codex_message_processor.rs` still contains route dispatch, JSON-RPC response shaping, watcher registration/snapshotting calls, and notification emission, but its root no longer imports the evacuated Epiphany policy/protocol registry or owns the watcher invalidation manager. Codex product surfaces for apps, skills, plugins, marketplace, and external agent config import are now inert in the app-server compatibility path: list routes return empty lists, mutation/detail/import routes report disabled, `externalAgentConfig/detect` returns no import candidates, helper/import modules and stale implementation-shape tests were deleted, runtime feature enablement no longer supports `apps` or `plugins`, config writes no longer emit plugin-toggle analytics, plugin/skill cache invalidation on config writes is gone, plugin startup warmups and app-list refreshes were removed, and app-server no longer directly depends on `codex-plugin`, `codex-chatgpt`, or `codex-core-plugins`. `Config::to_mcp_config` now keeps user-declared MCP servers but no longer accepts `PluginsManager`, folds plugin MCP servers into the runtime, enables Codex apps, enables skill MCP dependency install, or advertises plugin capability summaries; `TurnContext::apps_enabled()` now returns false so model turns cannot awaken Codex Apps through ChatGPT auth or feature flags; session startup and per-turn context no longer load skills, turns receive an empty `SkillLoadOutcome`, internal `Op::ListSkills` is gone from `codex-protocol` / `codex-core` / TUI command routing, the Codex skill watcher has been collapsed to a no-op marker with no file watcher, skill-root registration, cache-clear task, or `SkillsUpdateAvailable` session listener, model turns no longer run skill mention collection, skill env-var prompts, skill MCP dependency installation, skill instruction injection, or implicit skill invocation analytics from shell tools, and the turn prompt/router path no longer loads plugin/app capability summaries, injects available-skill/available-plugin/plugin instruction fragments, parses plugin/app mentions, records app/plugin invocation telemetry, or filters MCP tools through Codex app connectors. Skill mutation/list/notification is gone from the app-server edge too: `skills/list`, `skills/config/write`, `skills/changed`, `Op::ListSkills`, `EventMsg::ListSkillsResponse`, `EventMsg::SkillsUpdateAvailable`, the app-server handlers, TUI slash/startup/list/manage-skill surfaces, generated schema entries, core skill-list suite, and fake live-reload/developer-message tests were deleted. The TUI app connector product path is also deleted: no `/apps` slash command, app-link view, connector AppEvent variants, app connector cache/popup/refresh loop, app mention insertion, `app://` mention codec support, stale app-popup tests, or TUI browser-opening shim remains. The `app/list` route and `app/list/updated` notification are gone from app-server protocol, generated schemas, app-server dispatch, test helpers, and docs; `AppInfo`/app-list metadata schema structs are deleted; the orphaned `codex-connectors` crate and `core::connectors` shim are deleted from the workspace; Codex app analytics no longer tracks `codex_app_mentioned` / `codex_app_used` facts, events, reducer arms, client APIs, or dedupe cache state; `[apps.*]`, `Feature::Apps`, `include_apps_instructions`, app config/read schemas, app managed requirements, app prompt tests, and app file-MCP tests are gone; `Feature::Plugins`, `Feature::RemotePlugin`, `plugin://` structured mentions, plugin instruction tags, and stale plugin popup snapshots are gone too; `[plugins]` / `[marketplaces]`, `PluginConfig`, `MarketplaceConfig`, marketplace edit helpers, stale plugin/external-agent README route claims, and generated schema entries are removed from config; and the bundled `codex-skills` sample-skill crate plus embedded imagegen/openai-docs/plugin-creator/skill-creator/skill-installer payloads are deleted from the workspace. Live MCP tool approval is named `McpToolApproval`, not `AppToolApproval`, and remains under MCP server config; live structured tool mentions are MCP/skill-shaped only. `codex_message_processor.rs` is about 9,637 lines; root `message_processor.rs` is about 1,292 lines after the external-agent/config-product cuts; `epiphany_read_routes.rs` is about 579 lines after the full view and read-response extractions; `epiphany_mutation_routes.rs` is about 694 lines after route-load/notification helper cuts and product-surface starvation; `epiphany_state_helpers.rs` is down to a 19-line rollout-state loader; and `codex_thread.rs` is about 1,425 lines after state-update law moved native. `epiphany-openai-adapter` defines CultCache `DatabaseEntry` request/event/receipt/auth-status documents with no Codex app-server or generic JSON dependency. `epiphany-openai-codex-spine` owns all direct Codex auth/model-transport imports for the native OpenAI path: it exposes `default_codex_home` and `auth_manager`, projects `AuthManager` / `CodexAuth` into typed `EpiphanyOpenAiAdapterStatus`, maps typed `EpiphanyOpenAiModelRequest` into Codex API `ResponsesApiRequest`, resolves auth/provider through keeper Codex crates, opens HTTP Responses streams through `codex-api`, maps deltas / completion into typed stream events and receipts, and no longer directly depends on `codex-app-server-protocol` just to name auth mode. `epiphany-openai-runtime` no longer depends directly on `codex-login`; it writes OpenAI status/request/stream-event/receipt records plus runtime sessions/jobs/results/events into `epiphany-core::runtime_spine_cache`, can emit the assistant text artifact for legacy result consumers, is now the default executor for startup-only repo birth specialists, and now has `run-worker` to load a durable `EpiphanyRuntimeWorkerLaunchRequest`, call the typed OpenAI runtime through the spine, persist typed `EpiphanyRuntimeRoleWorkerResult` / `EpiphanyRuntimeReorientWorkerResult` documents, and complete the original heartbeat/specialist runtime job without Codex worker execution; `codex exec` survives only as explicit fallback in repo-birth startup. `epiphany-mvp-coordinator` now invokes `epiphany-openai-runtime run-worker` for launched runtime job ids and no longer creates a second coordinator-owned shadow runtime job/result as a compensator. `epiphany-core::plan_runtime_spine_heartbeat_launch` validates launch contracts/conflicts and projects durable job bindings/runtime links; `epiphany-core::open_runtime_spine_heartbeat_job` owns the initialize-runtime/ensure-session/create-job sequence and now persists `EpiphanyRuntimeWorkerLaunchRequest` CultCache records keyed by runtime job id, with indexed kind/contract fields plus MessagePack-encoded typed launch documents instead of discarding work intent after queue receipt creation; `roleResult` and `reorientResult` now prefer typed worker result documents and fall back only to generic job summaries for older receipts; `epiphany-core::EpiphanyStateUpdate`, `epiphany_state_update_validation_errors`, and `apply_epiphany_state_update` own state-update document shape and mutation law while `codex-core` calls them for compatibility. Vendored `CodexThread::epiphany_launch_job` is now mostly revision check, persistence validation, launch request handoff, and rollout/session writeback for the compatibility route. Vendored `codex-core` no longer has `epiphany_distillation`, `epiphany_promotion`, `epiphany_proposal`, or `epiphany_retrieval` husk modules; it re-exports native surfaces from `epiphany-core` directly, and now owns only the real Codex rollout adapter because it is a host seam. `epiphany-runtime-spine` advertises OpenAI adapter status/model-request/stream-event/receipt CultNet schemas and mutation contracts, so the native caller now has a real storage route instead of only JSON-RPC. MCP itself is correctly JSON at its protocol edge; the target is typed Epiphany intent/result/receipt wrappers around MCP, not replacing MCP JSON. The current OpenAI spine still pulls `codex-api` and a large transport dependency stack, so its next cut is dependency starvation after richer live callers move. + summary: The Codex starvation pass has five typing receipts, forty-eight processor/foundation cuts, a real physical extraction in `epiphany-codex-bridge`, a root `epiphany-state-model` crate for durable Epiphany state, a source-grounded Codex auth spine inventory, the native `epiphany-openai-adapter` document boundary, a buildable Codex auth/model wrapper in `epiphany-openai-codex-spine`, the first native runtime caller in `epiphany-openai-runtime`, native heartbeat launch planning/job opening in `epiphany-core`, native state-update contract/validation/application in `epiphany-core`, native exact retrieval path matching in `epiphany-core`, and the route-facing mutation/view/coordinator projection services in `epiphany-codex-bridge`. `codex-protocol` no longer defines the durable `Epiphany*` state structs; it re-exports the native model for legacy rollout/API compatibility while `epiphany-core` imports the native model directly. `epiphany-core` now has no direct vendored Codex dependency: pressure derivation accepts native `EpiphanyTokenUsageSnapshot`, Codex rollout replay moved to `codex-core::epiphany_rollout`, and exact retrieval search uses Epiphany-owned workspace walking/path scoring instead of `codex-file-search`. The bridge owns Codex-facing Epiphany adapters for scene, jobs, context/planning/graph query, retrieval/indexing projection, result projection, runtime-spine result adaptation, launch/prompt doctrine, mutation document mechanics, mutation service update/promote/role-accept/reorient-accept/role-launch/reorient-launch/job-launch/job-interrupt application, live-state projection, pressure/pre-compaction rendering, freshness/reorientation projection, CRRC/coordinator/role-board projection, watcher invalidation adaptation, full `thread/epiphany/view` response construction, freshness/context/graph-query response construction, role/reorient result response construction, distill/propose patch-response construction, coordinator status/view construction, and acceptance/evidence signal helpers. Vendored app-server no longer retains root Epiphany modules; `codex_message_processor.rs` still contains route dispatch, JSON-RPC response shaping, watcher registration/snapshotting calls, and notification emission, but its root no longer imports the evacuated Epiphany policy/protocol registry or owns the watcher invalidation manager. Codex product surfaces for apps, skills, plugins, marketplace, and external agent config import are now inert in the app-server compatibility path: list routes return empty lists, mutation/detail/import routes report disabled, `externalAgentConfig/detect` returns no import candidates, helper/import modules and stale implementation-shape tests were deleted, runtime feature enablement no longer supports `apps` or `plugins`, config writes no longer emit plugin-toggle analytics, plugin/skill cache invalidation on config writes is gone, plugin startup warmups and app-list refreshes were removed, and app-server no longer directly depends on `codex-plugin`, `codex-chatgpt`, or `codex-core-plugins`. `Config::to_mcp_config` now keeps user-declared MCP servers but no longer accepts `PluginsManager`, folds plugin MCP servers into the runtime, enables Codex apps, enables skill MCP dependency install, or advertises plugin capability summaries; `TurnContext::apps_enabled()` now returns false so model turns cannot awaken Codex Apps through ChatGPT auth or feature flags; session startup and per-turn context no longer load skills, turns receive an empty `SkillLoadOutcome`, internal `Op::ListSkills` is gone from `codex-protocol` / `codex-core` / TUI command routing, the Codex skill watcher has been collapsed to a no-op marker with no file watcher, skill-root registration, cache-clear task, or `SkillsUpdateAvailable` session listener, model turns no longer run skill mention collection, skill env-var prompts, skill MCP dependency installation, skill instruction injection, or implicit skill invocation analytics from shell tools, and the turn prompt/router path no longer loads plugin/app capability summaries, injects available-skill/available-plugin/plugin instruction fragments, parses plugin/app mentions, records app/plugin invocation telemetry, or filters MCP tools through Codex app connectors. Skill mutation/list/notification is gone from the app-server edge too: `skills/list`, `skills/config/write`, `skills/changed`, `Op::ListSkills`, `EventMsg::ListSkillsResponse`, `EventMsg::SkillsUpdateAvailable`, the app-server handlers, TUI slash/startup/list/manage-skill surfaces, generated schema entries, core skill-list suite, and fake live-reload/developer-message tests were deleted. Skill mention plumbing is also gone from the live TUI/protocol edge: no `UserInput::Skill` variant, app-server schema branch, TUI skill popup, `skills_all` cache, composer `set_skill_mentions`, skill mention insertion, `skill://` / `SKILL.md` history decoding, or stale skill popup snapshot remains. The TUI app connector product path is also deleted: no `/apps` slash command, app-link view, connector AppEvent variants, app connector cache/popup/refresh loop, app mention insertion, `app://` mention codec support, stale app-popup tests, or TUI browser-opening shim remains. The `app/list` route and `app/list/updated` notification are gone from app-server protocol, generated schemas, app-server dispatch, test helpers, and docs; `AppInfo`/app-list metadata schema structs are deleted; the orphaned `codex-connectors` crate and `core::connectors` shim are deleted from the workspace; Codex app analytics no longer tracks `codex_app_mentioned` / `codex_app_used` facts, events, reducer arms, client APIs, or dedupe cache state; `[apps.*]`, `Feature::Apps`, `include_apps_instructions`, app config/read schemas, app managed requirements, app prompt tests, and app file-MCP tests are gone; `Feature::Plugins`, `Feature::RemotePlugin`, `plugin://` structured mentions, plugin instruction tags, and stale plugin popup snapshots are gone too; `[plugins]` / `[marketplaces]`, `PluginConfig`, `MarketplaceConfig`, marketplace edit helpers, stale plugin/external-agent README route claims, and generated schema entries are removed from config; and the bundled `codex-skills` sample-skill crate plus embedded imagegen/openai-docs/plugin-creator/skill-creator/skill-installer payloads are deleted from the workspace. Live MCP tool approval is named `McpToolApproval`, not `AppToolApproval`, and remains under MCP server config; live structured user-input mentions are MCP-shaped only. `codex_message_processor.rs` is about 9,637 lines; root `message_processor.rs` is about 1,292 lines after the external-agent/config-product cuts; `epiphany_read_routes.rs` is about 579 lines after the full view and read-response extractions; `epiphany_mutation_routes.rs` is about 694 lines after route-load/notification helper cuts and product-surface starvation; `epiphany_state_helpers.rs` is down to a 19-line rollout-state loader; and `codex_thread.rs` is about 1,425 lines after state-update law moved native. `epiphany-openai-adapter` defines CultCache `DatabaseEntry` request/event/receipt/auth-status documents with no Codex app-server or generic JSON dependency. `epiphany-openai-codex-spine` owns all direct Codex auth/model-transport imports for the native OpenAI path: it exposes `default_codex_home` and `auth_manager`, projects `AuthManager` / `CodexAuth` into typed `EpiphanyOpenAiAdapterStatus`, maps typed `EpiphanyOpenAiModelRequest` into Codex API `ResponsesApiRequest`, resolves auth/provider through keeper Codex crates, opens HTTP Responses streams through `codex-api`, maps deltas / completion into typed stream events and receipts, and no longer directly depends on `codex-app-server-protocol` just to name auth mode. `epiphany-openai-runtime` no longer depends directly on `codex-login`; it writes OpenAI status/request/stream-event/receipt records plus runtime sessions/jobs/results/events into `epiphany-core::runtime_spine_cache`, can emit the assistant text artifact for legacy result consumers, is now the default executor for startup-only repo birth specialists, and now has `run-worker` to load a durable `EpiphanyRuntimeWorkerLaunchRequest`, call the typed OpenAI runtime through the spine, persist typed `EpiphanyRuntimeRoleWorkerResult` / `EpiphanyRuntimeReorientWorkerResult` documents, and complete the original heartbeat/specialist runtime job without Codex worker execution; `codex exec` survives only as explicit fallback in repo-birth startup. `epiphany-mvp-coordinator` now invokes `epiphany-openai-runtime run-worker` for launched runtime job ids and no longer creates a second coordinator-owned shadow runtime job/result as a compensator. `epiphany-core::plan_runtime_spine_heartbeat_launch` validates launch contracts/conflicts and projects durable job bindings/runtime links; `epiphany-core::open_runtime_spine_heartbeat_job` owns the initialize-runtime/ensure-session/create-job sequence and now persists `EpiphanyRuntimeWorkerLaunchRequest` CultCache records keyed by runtime job id, with indexed kind/contract fields plus MessagePack-encoded typed launch documents instead of discarding work intent after queue receipt creation; `roleResult` and `reorientResult` now prefer typed worker result documents and fall back only to generic job summaries for older receipts; `epiphany-core::EpiphanyStateUpdate`, `epiphany_state_update_validation_errors`, and `apply_epiphany_state_update` own state-update document shape and mutation law while `codex-core` calls them for compatibility. Vendored `CodexThread::epiphany_launch_job` is now mostly revision check, persistence validation, launch request handoff, and rollout/session writeback for the compatibility route. Vendored `codex-core` no longer has `epiphany_distillation`, `epiphany_promotion`, `epiphany_proposal`, or `epiphany_retrieval` husk modules; it re-exports native surfaces from `epiphany-core` directly, and now owns only the real Codex rollout adapter because it is a host seam. `epiphany-runtime-spine` advertises OpenAI adapter status/model-request/stream-event/receipt CultNet schemas and mutation contracts, so the native caller now has a real storage route instead of only JSON-RPC. MCP itself is correctly JSON at its protocol edge; the target is typed Epiphany intent/result/receipt wrappers around MCP, not replacing MCP JSON. The current OpenAI spine still pulls `codex-api` and a large transport dependency stack, so its next cut is dependency starvation after richer live callers move. latest_cut: > Codex Apps no longer have privileged MCP/runtime treatment in the keeper path. MCP exposure is now uniform: small tool sets are direct, large or @@ -369,8 +369,7 @@ current_status: mention residue is gone too: no `Feature::Plugins`, `Feature::RemotePlugin`, `plugin://` structured mention support, plugin instruction tags, stale plugin popup snapshots, or app/plugin mention path - classification in `codex-core-skills` remain. Live structured mentions are - MCP/skill-shaped only. Config no longer accepts `[plugins]` or + classification in `codex-core-skills` remain. Config no longer accepts `[plugins]` or `[marketplaces]`, and the old marketplace edit helper module plus stale plugin/external-agent app-server README route claims were deleted. The bundled `codex-skills` crate is gone as well: no embedded sample @@ -382,6 +381,10 @@ current_status: app-server handlers, TUI slash/startup/list/manage-skill surfaces, generated schema entries, core skill-list suite, and stale live-reload/developer-message tests were deleted. - MCP remains JSON-RPC at the edge; user-declared MCP - servers are the only runtime MCP authority. + The TUI/protocol skill mention organ is deleted: no `UserInput::Skill`, + app-server schema branch, TUI skill popup, `skills_all` cache, + composer `set_skill_mentions`, skill mention insertion, `skill://` / + `SKILL.md` history decoding, or stale skill popup snapshot remains. Live + structured user-input mentions are MCP-shaped only. MCP remains JSON-RPC at + the edge; user-declared MCP servers are the only runtime MCP authority. next_action: Continue starving coordinator/runtime execution and operator surfaces off app-server JSON-RPC and out of `codex_message_processor.rs`; keep the vestigial Codex organ narrowed to subscription auth/model transport. diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/ClientRequest.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/ClientRequest.json index 4967ab77..00bda024 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/ClientRequest.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/ClientRequest.json @@ -4036,30 +4036,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/ServerNotification.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/ServerNotification.json index 1f757591..e07fdc22 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/ServerNotification.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/ServerNotification.json @@ -6895,30 +6895,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index b66d7183..8650a783 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -9714,30 +9714,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index 5af858f4..ff6d7776 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -5140,30 +5140,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ @@ -14792,27 +14768,45 @@ } } }, - "InitializeCapabilities": { - "description": "Client-declared capabilities negotiated during initialize.", + "FuzzyFileSearchParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchParams", "type": "object", + "required": [ + "query", + "roots" + ], "properties": { - "experimentalApi": { - "description": "Opt into receiving experimental API methods and fields.", - "default": false, - "type": "boolean" - }, - "optOutNotificationMethods": { - "description": "Exact notification method names that should be suppressed for this connection (for example `thread/started`).", + "cancellationToken": { "type": [ - "array", + "string", "null" - ], + ] + }, + "query": { + "type": "string" + }, + "roots": { + "type": "array", "items": { "type": "string" } } } }, + "FuzzyFileSearchSessionCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchSessionCompletedNotification", + "type": "object", + "required": [ + "sessionId" + ], + "properties": { + "sessionId": { + "type": "string" + } + } + }, "InitializeParams": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InitializeParams", @@ -14836,15 +14830,30 @@ } } }, - "FuzzyFileSearchSessionCompletedNotification": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "FuzzyFileSearchSessionCompletedNotification", + "FuzzyFileSearchMatchType": { + "type": "string", + "enum": [ + "file", + "directory" + ] + }, + "ClientInfo": { "type": "object", "required": [ - "sessionId" + "name", + "version" ], "properties": { - "sessionId": { + "name": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "version": { "type": "string" } } @@ -14873,60 +14882,27 @@ } } }, - "FuzzyFileSearchMatchType": { - "type": "string", - "enum": [ - "file", - "directory" - ] - }, - "FuzzyFileSearchParams": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "FuzzyFileSearchParams", + "InitializeCapabilities": { + "description": "Client-declared capabilities negotiated during initialize.", "type": "object", - "required": [ - "query", - "roots" - ], "properties": { - "cancellationToken": { + "experimentalApi": { + "description": "Opt into receiving experimental API methods and fields.", + "default": false, + "type": "boolean" + }, + "optOutNotificationMethods": { + "description": "Exact notification method names that should be suppressed for this connection (for example `thread/started`).", "type": [ - "string", + "array", "null" - ] - }, - "query": { - "type": "string" - }, - "roots": { - "type": "array", + ], "items": { "type": "string" } } } }, - "ClientInfo": { - "type": "object", - "required": [ - "name", - "version" - ], - "properties": { - "name": { - "type": "string" - }, - "title": { - "type": [ - "string", - "null" - ] - }, - "version": { - "type": "string" - } - } - }, "FuzzyFileSearchResult": { "description": "Superset of [`codex_file_search::FileMatch`]", "type": "object", diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json index f979879f..f8ac6aa5 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ItemCompletedNotification.json @@ -1235,30 +1235,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json index 0491db4c..7b51e4a4 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ItemStartedNotification.json @@ -1235,30 +1235,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json index 6fe01a9e..b29fd46d 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ReviewStartResponse.json @@ -1470,30 +1470,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json index ca5a6d3e..4e8d67a8 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json @@ -3905,30 +3905,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json index 22070f9c..2a2306f2 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json @@ -3340,30 +3340,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json index f9bf8580..8088377d 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json @@ -3323,30 +3323,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json index 590bcbe8..68c0e574 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json @@ -3323,30 +3323,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json index d593a198..0637c736 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json @@ -3905,30 +3905,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json index 829a9f23..5497d726 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json @@ -3328,30 +3328,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json index 11e511a3..c8373b86 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json @@ -3905,30 +3905,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json index e1148e8b..2d3b8a04 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json @@ -3323,30 +3323,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadTurnsListResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadTurnsListResponse.json index ac218967..c688d197 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadTurnsListResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadTurnsListResponse.json @@ -1482,30 +1482,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json index 54233a88..1233af85 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json @@ -3323,30 +3323,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json index c6f52fb9..e19ccb94 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnCompletedNotification.json @@ -1469,30 +1469,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnStartParams.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnStartParams.json index de22b3f6..8d59525a 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnStartParams.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnStartParams.json @@ -861,30 +861,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json index 52fa4969..79d07dab 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnStartResponse.json @@ -1465,30 +1465,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json index 1eccc825..d50ce258 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnStartedNotification.json @@ -1469,30 +1469,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnSteerParams.json b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnSteerParams.json index f34390e0..c7cd8fd0 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnSteerParams.json +++ b/vendor/codex/codex-rs/app-server-protocol/schema/json/v2/TurnSteerParams.json @@ -135,30 +135,6 @@ }, "title": "LocalImageUserInput" }, - { - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ], - "title": "SkillUserInputType" - } - }, - "title": "SkillUserInput" - }, { "type": "object", "required": [ diff --git a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/UserInput.ts b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/UserInput.ts index 38abc233..be317597 100644 --- a/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/UserInput.ts +++ b/vendor/codex/codex-rs/app-server-protocol/schema/typescript/v2/UserInput.ts @@ -7,4 +7,4 @@ export type UserInput = { "type": "text", text: string, /** * UI-defined spans within `text` used to render or persist special elements. */ -text_elements: Array, } | { "type": "image", url: string, } | { "type": "localImage", path: string, } | { "type": "skill", name: string, path: string, } | { "type": "mention", name: string, path: string, }; +text_elements: Array, } | { "type": "image", url: string, } | { "type": "localImage", path: string, } | { "type": "mention", name: string, path: string, }; diff --git a/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs b/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs index 9e6a77e6..de9a3eed 100644 --- a/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs +++ b/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs @@ -6171,10 +6171,6 @@ pub enum UserInput { LocalImage { path: PathBuf, }, - Skill { - name: String, - path: PathBuf, - }, Mention { name: String, path: String, @@ -6193,7 +6189,6 @@ impl UserInput { }, UserInput::Image { url } => CoreUserInput::Image { image_url: url }, UserInput::LocalImage { path } => CoreUserInput::LocalImage { path }, - UserInput::Skill { name, path } => CoreUserInput::Skill { name, path }, UserInput::Mention { name, path } => CoreUserInput::Mention { name, path }, } } @@ -6211,7 +6206,6 @@ impl From for UserInput { }, CoreUserInput::Image { image_url } => UserInput::Image { url: image_url }, CoreUserInput::LocalImage { path } => UserInput::LocalImage { path }, - CoreUserInput::Skill { name, path } => UserInput::Skill { name, path }, CoreUserInput::Mention { name, path } => UserInput::Mention { name, path }, _ => unreachable!("unsupported user input variant"), } @@ -6222,10 +6216,7 @@ impl UserInput { pub fn text_char_count(&self) -> usize { match self { UserInput::Text { text, .. } => text.chars().count(), - UserInput::Image { .. } - | UserInput::LocalImage { .. } - | UserInput::Skill { .. } - | UserInput::Mention { .. } => 0, + UserInput::Image { .. } | UserInput::LocalImage { .. } | UserInput::Mention { .. } => 0, } } } @@ -10401,10 +10392,6 @@ mod tests { CoreUserInput::LocalImage { path: PathBuf::from("local/image.png"), }, - CoreUserInput::Skill { - name: "skill-creator".to_string(), - path: PathBuf::from("/repo/.codex/skills/skill-creator/SKILL.md"), - }, CoreUserInput::Mention { name: "Docs MCP".to_string(), path: "mcp://docs".to_string(), @@ -10427,10 +10414,6 @@ mod tests { UserInput::LocalImage { path: PathBuf::from("local/image.png"), }, - UserInput::Skill { - name: "skill-creator".to_string(), - path: PathBuf::from("/repo/.codex/skills/skill-creator/SKILL.md"), - }, UserInput::Mention { name: "Docs MCP".to_string(), path: "mcp://docs".to_string(), diff --git a/vendor/codex/codex-rs/core-skills/src/injection.rs b/vendor/codex/codex-rs/core-skills/src/injection.rs index ed192a7e..26bd6b07 100644 --- a/vendor/codex/codex-rs/core-skills/src/injection.rs +++ b/vendor/codex/codex-rs/core-skills/src/injection.rs @@ -11,7 +11,6 @@ use codex_analytics::SkillInvocation; use codex_analytics::TrackEventsContext; use codex_exec_server::LOCAL_FS; use codex_otel::SessionTelemetry; -use codex_protocol::user_input::UserInput; use codex_utils_absolute_path::AbsolutePathBuf; const TOOL_MENTION_SIGIL: char = '$'; @@ -101,19 +100,18 @@ fn emit_skill_injected_metric( ); } -/// Collect explicitly mentioned skills from structured and text mentions. +/// Collect explicitly mentioned skills from text mentions. /// -/// Structured `UserInput::Skill` selections are resolved first by path against -/// enabled skills. Text inputs are then scanned to extract `$skill-name` tokens, and we -/// iterate `skills` in their existing order to preserve prior ordering semantics. +/// Text inputs are scanned to extract `$skill-name` tokens, and we iterate `skills` in +/// their existing order to preserve prior ordering semantics. /// Explicit links are resolved by path and plain names are only used when the match /// is unambiguous. /// -/// Complexity: `O(T + (N_s + N_t) * S)` time, `O(S + M)` space, where: -/// `S` = number of skills, `T` = total text length, `N_s` = number of structured skill inputs, -/// `N_t` = number of text inputs, `M` = max mentions parsed from a single text input. +/// Complexity: `O(T + N * S)` time, `O(S + M)` space, where: +/// `S` = number of skills, `T` = total text length, `N` = number of text inputs, +/// and `M` = max mentions parsed from a single text input. pub fn collect_explicit_skill_mentions( - inputs: &[UserInput], + inputs: &[codex_protocol::user_input::UserInput], skills: &[SkillMetadata], disabled_paths: &HashSet, connector_slug_counts: &HashMap, @@ -129,37 +127,12 @@ pub fn collect_explicit_skill_mentions( let mut selected: Vec = Vec::new(); let mut seen_names: HashSet = HashSet::new(); let mut seen_paths: HashSet = HashSet::new(); - let mut blocked_plain_names: HashSet = HashSet::new(); for input in inputs { - if let UserInput::Skill { name, path } = input { - blocked_plain_names.insert(name.clone()); - let Ok(path) = AbsolutePathBuf::relative_to_current_dir(path) else { - continue; - }; - - if selection_context.disabled_paths.contains(&path) || seen_paths.contains(&path) { - continue; - } - - if let Some(skill) = selection_context - .skills - .iter() - .find(|skill| skill.path_to_skills_md == path) - { - seen_paths.insert(skill.path_to_skills_md.clone()); - seen_names.insert(skill.name.clone()); - selected.push(skill.clone()); - } - } - } - - for input in inputs { - if let UserInput::Text { text, .. } = input { + if let codex_protocol::user_input::UserInput::Text { text, .. } = input { let mentioned_names = extract_tool_mentions(text); select_skills_from_mentions( &selection_context, - &blocked_plain_names, &mentioned_names, &mut seen_names, &mut seen_paths, @@ -300,7 +273,6 @@ pub fn extract_tool_mentions_with_sigil(text: &str, sigil: char) -> ToolMentions /// Select mentioned skills while preserving the order of `skills`. fn select_skills_from_mentions( selection_context: &SkillSelectionContext<'_>, - blocked_plain_names: &HashSet, mentions: &ToolMentions<'_>, seen_names: &mut HashSet, seen_paths: &mut HashSet, @@ -342,9 +314,6 @@ fn select_skills_from_mentions( continue; } - if blocked_plain_names.contains(skill.name.as_str()) { - continue; - } if !mentions.plain_names.contains(skill.name.as_str()) { continue; } diff --git a/vendor/codex/codex-rs/core-skills/src/injection_tests.rs b/vendor/codex/codex-rs/core-skills/src/injection_tests.rs index 1b755e8c..e9cd1472 100644 --- a/vendor/codex/codex-rs/core-skills/src/injection_tests.rs +++ b/vendor/codex/codex-rs/core-skills/src/injection_tests.rs @@ -1,4 +1,5 @@ use super::*; +use codex_protocol::user_input::UserInput; use codex_utils_absolute_path::AbsolutePathBuf; use codex_utils_absolute_path::test_support::PathBufExt; use codex_utils_absolute_path::test_support::test_path_buf; @@ -146,71 +147,6 @@ fn collect_explicit_skill_mentions_text_respects_skill_order() { assert_eq!(selected, vec![beta, alpha]); } -#[test] -fn collect_explicit_skill_mentions_prioritizes_structured_inputs() { - let alpha = make_skill("alpha-skill", "/tmp/alpha"); - let beta = make_skill("beta-skill", "/tmp/beta"); - let skills = vec![alpha.clone(), beta.clone()]; - let inputs = vec![ - UserInput::Text { - text: "please run $alpha-skill".to_string(), - text_elements: Vec::new(), - }, - UserInput::Skill { - name: "beta-skill".to_string(), - path: test_path_buf("/tmp/beta"), - }, - ]; - let connector_counts = HashMap::new(); - - let selected = collect_mentions(&inputs, &skills, &HashSet::new(), &connector_counts); - - assert_eq!(selected, vec![beta, alpha]); -} - -#[test] -fn collect_explicit_skill_mentions_skips_invalid_structured_and_blocks_plain_fallback() { - let alpha = make_skill("alpha-skill", "/tmp/alpha"); - let skills = vec![alpha]; - let inputs = vec![ - UserInput::Text { - text: "please run $alpha-skill".to_string(), - text_elements: Vec::new(), - }, - UserInput::Skill { - name: "alpha-skill".to_string(), - path: test_path_buf("/tmp/missing"), - }, - ]; - let connector_counts = HashMap::new(); - - let selected = collect_mentions(&inputs, &skills, &HashSet::new(), &connector_counts); - - assert_eq!(selected, Vec::new()); -} - -#[test] -fn collect_explicit_skill_mentions_skips_disabled_structured_and_blocks_plain_fallback() { - let alpha = make_skill("alpha-skill", "/tmp/alpha"); - let skills = vec![alpha]; - let inputs = vec![ - UserInput::Text { - text: "please run $alpha-skill".to_string(), - text_elements: Vec::new(), - }, - UserInput::Skill { - name: "alpha-skill".to_string(), - path: test_path_buf("/tmp/alpha"), - }, - ]; - let disabled = HashSet::from([test_path_buf("/tmp/alpha").abs()]); - let connector_counts = HashMap::new(); - - let selected = collect_mentions(&inputs, &skills, &disabled, &connector_counts); - - assert_eq!(selected, Vec::new()); -} - #[test] fn collect_explicit_skill_mentions_dedupes_by_path() { let alpha = make_skill("alpha-skill", "/tmp/alpha"); diff --git a/vendor/codex/codex-rs/core/src/agent/control.rs b/vendor/codex/codex-rs/core/src/agent/control.rs index 08579536..04ff07e9 100644 --- a/vendor/codex/codex-rs/core/src/agent/control.rs +++ b/vendor/codex/codex-rs/core/src/agent/control.rs @@ -1202,7 +1202,6 @@ pub(crate) fn render_input_preview(initial_operation: &Op) -> String { UserInput::Text { text, .. } => text.clone(), UserInput::Image { .. } => "[image]".to_string(), UserInput::LocalImage { path } => format!("[local_image:{}]", path.display()), - UserInput::Skill { name, path } => format!("[skill:${name}]({})", path.display()), UserInput::Mention { name, path } => format!("[mention:${name}]({path})"), _ => "[input]".to_string(), }) diff --git a/vendor/codex/codex-rs/protocol/src/models.rs b/vendor/codex/codex-rs/protocol/src/models.rs index 551723c7..0bf40973 100644 --- a/vendor/codex/codex-rs/protocol/src/models.rs +++ b/vendor/codex/codex-rs/protocol/src/models.rs @@ -944,7 +944,7 @@ impl From> for ResponseInputItem { Err(err) => vec![local_image_error_placeholder(&path, err)], } } - UserInput::Skill { .. } | UserInput::Mention { .. } => Vec::new(), // Tool bodies are injected later in core + UserInput::Mention { .. } => Vec::new(), }) .collect::>(), } diff --git a/vendor/codex/codex-rs/protocol/src/user_input.rs b/vendor/codex/codex-rs/protocol/src/user_input.rs index 5fdc45e0..01ce45d3 100644 --- a/vendor/codex/codex-rs/protocol/src/user_input.rs +++ b/vendor/codex/codex-rs/protocol/src/user_input.rs @@ -27,15 +27,10 @@ pub enum UserInput { /// `Image` variant (base64 data URL) during request serialization. LocalImage { path: std::path::PathBuf }, - /// Skill selected by the user (name + path to SKILL.md). - Skill { - name: String, - path: std::path::PathBuf, - }, /// Explicit structured mention selected by the user. /// /// `path` identifies the exact mention target, for example - /// `mcp://` or a path to `SKILL.md`. + /// `mcp://`. Mention { name: String, path: String }, } diff --git a/vendor/codex/codex-rs/tui/src/bottom_pane/chat_composer.rs b/vendor/codex/codex-rs/tui/src/bottom_pane/chat_composer.rs index ea0deb30..0fea3a1e 100644 --- a/vendor/codex/codex-rs/tui/src/bottom_pane/chat_composer.rs +++ b/vendor/codex/codex-rs/tui/src/bottom_pane/chat_composer.rs @@ -3,7 +3,7 @@ //! It is responsible for: //! //! - Editing the input buffer (a [`TextArea`]), including placeholder "elements" for attachments. -//! - Routing keys to the active popup (slash commands, file search, skill mentions). +//! - Routing keys to the active popup (slash commands and file search). //! - Promoting typed slash commands into atomic elements when the command name is completed. //! - Handling submit vs newline on Enter. //! - Turning raw key streams into explicit paste operations on platforms where terminals @@ -177,8 +177,6 @@ use super::footer::toggle_shortcut_mode; use super::footer::uses_passive_footer_status_layout; use super::paste_burst::CharDecision; use super::paste_burst::PasteBurst; -use super::skill_popup::MentionItem; -use super::skill_popup::SkillPopup; use super::slash_commands; use super::slash_commands::BuiltinCommandFlags; use crate::bottom_pane::paste_burst::FlushResult; @@ -205,12 +203,8 @@ use crate::bottom_pane::textarea::TextAreaState; use crate::clipboard_paste::normalize_pasted_path; use crate::clipboard_paste::pasted_image_format; use crate::history_cell; -use crate::skills_helpers::skill_display_name; use crate::tui::FrameRequester; use crate::ui_consts::LIVE_PREFIX_COLS; -#[cfg(test)] -use codex_core_skills::model::SkillInterface; -use codex_core_skills::model::SkillMetadata; use codex_file_search::FileMatch; use std::cell::RefCell; use std::collections::HashMap; @@ -357,8 +351,6 @@ pub(crate) struct ChatComposer { #[cfg(not(target_os = "linux"))] next_element_id: u64, context_window_used_tokens: Option, - skills: Option>, - dismissed_mention_popup_token: Option, mention_bindings: HashMap, recent_submission_mention_bindings: Vec, collaboration_modes_enabled: bool, @@ -407,7 +399,6 @@ enum ActivePopup { None, Command(CommandPopup), File(FileSearchPopup), - Skill(SkillPopup), } #[derive(Clone, Copy, Debug, PartialEq, Eq)] @@ -496,8 +487,6 @@ impl ChatComposer { #[cfg(not(target_os = "linux"))] next_element_id: 0, context_window_used_tokens: None, - skills: None, - dismissed_mention_popup_token: None, mention_bindings: HashMap::new(), recent_submission_mention_bindings: Vec::new(), collaboration_modes_enabled: false, @@ -535,11 +524,6 @@ impl ChatComposer { self.frame_requester = Some(frame_requester); } - pub fn set_skill_mentions(&mut self, skills: Option>) { - self.skills = skills; - self.sync_popups(); - } - /// Toggle composer-side image paste handling. /// /// This only affects whether image-like paste content is converted into attachments; the @@ -627,9 +611,6 @@ impl ChatComposer { Constraint::Max(popup.calculate_required_height(area.width)) } ActivePopup::File(popup) => Constraint::Max(popup.calculate_required_height()), - ActivePopup::Skill(popup) => { - Constraint::Max(popup.calculate_required_height(area.width)) - } ActivePopup::None => Constraint::Max(footer_total_height), }; let [composer_rect, popup_rect] = @@ -1395,7 +1376,6 @@ impl ChatComposer { let result = match &mut self.active_popup { ActivePopup::Command(_) => self.handle_key_event_with_slash_popup(key_event), ActivePopup::File(_) => self.handle_key_event_with_file_popup(key_event), - ActivePopup::Skill(_) => self.handle_key_event_with_skill_popup(key_event), ActivePopup::None => self.handle_key_event_without_popup(key_event), }; // Update (or hide/show) popup after processing the key. @@ -1755,79 +1735,6 @@ impl ChatComposer { } } - fn handle_key_event_with_skill_popup(&mut self, key_event: KeyEvent) -> (InputResult, bool) { - if self.handle_shortcut_overlay_key(&key_event) { - return (InputResult::None, true); - } - self.footer_mode = reset_mode_after_activity(self.footer_mode); - - let ActivePopup::Skill(popup) = &mut self.active_popup else { - unreachable!(); - }; - - let mut selected_mention: Option<(String, Option)> = None; - let mut close_popup = false; - - let result = match key_event { - KeyEvent { - code: KeyCode::Up, .. - } - | KeyEvent { - code: KeyCode::Char('p'), - modifiers: KeyModifiers::CONTROL, - .. - } => { - popup.move_up(); - (InputResult::None, true) - } - KeyEvent { - code: KeyCode::Down, - .. - } - | KeyEvent { - code: KeyCode::Char('n'), - modifiers: KeyModifiers::CONTROL, - .. - } => { - popup.move_down(); - (InputResult::None, true) - } - KeyEvent { - code: KeyCode::Esc, .. - } => { - if let Some(tok) = self.current_mention_token() { - self.dismissed_mention_popup_token = Some(tok); - } - self.active_popup = ActivePopup::None; - (InputResult::None, true) - } - KeyEvent { - code: KeyCode::Tab, .. - } - | KeyEvent { - code: KeyCode::Enter, - modifiers: KeyModifiers::NONE, - .. - } => { - if let Some(mention) = popup.selected_mention() { - selected_mention = Some((mention.insert_text.clone(), mention.path.clone())); - } - close_popup = true; - (InputResult::None, true) - } - input => self.handle_input_basic(input), - }; - - if close_popup { - if let Some((insert_text, path)) = selected_mention { - self.insert_selected_mention(&insert_text, path.as_deref()); - } - self.active_popup = ActivePopup::None; - } - - result - } - fn is_image_path(path: &str) -> bool { let lower = path.to_ascii_lowercase(); lower.ends_with(".png") @@ -1942,18 +1849,6 @@ impl ChatComposer { (rebuilt, rebuilt_elements) } - pub fn skills(&self) -> Option<&Vec> { - self.skills.as_ref() - } - - fn mentions_enabled(&self) -> bool { - let skills_ready = self - .skills - .as_ref() - .is_some_and(|skills| !skills.is_empty()); - skills_ready - } - /// Extract a token prefixed with `prefix` under the cursor, if any. /// /// The returned string **does not** include the prefix. @@ -2079,13 +1974,6 @@ impl ChatComposer { Self::current_prefixed_token(textarea, '@', /*allow_empty*/ false) } - fn current_mention_token(&self) -> Option { - if !self.mentions_enabled() { - return None; - } - Self::current_prefixed_token(&self.textarea, '$', /*allow_empty*/ true) - } - /// Replace the active `@token` (the one under the cursor) with `path`. /// /// The algorithm mirrors `current_at_token` so replacement works no matter @@ -2132,51 +2020,6 @@ impl ChatComposer { self.textarea.set_cursor(new_cursor); } - fn insert_selected_mention(&mut self, insert_text: &str, path: Option<&str>) { - let cursor_offset = self.textarea.cursor(); - let text = self.textarea.text(); - let safe_cursor = Self::clamp_to_char_boundary(text, cursor_offset); - - let before_cursor = &text[..safe_cursor]; - let after_cursor = &text[safe_cursor..]; - - let start_idx = before_cursor - .char_indices() - .rfind(|(_, c)| c.is_whitespace()) - .map(|(idx, c)| idx + c.len_utf8()) - .unwrap_or(0); - - let end_rel_idx = after_cursor - .char_indices() - .find(|(_, c)| c.is_whitespace()) - .map(|(idx, _)| idx) - .unwrap_or(after_cursor.len()); - let end_idx = safe_cursor + end_rel_idx; - - // Remove the active token and insert the selected mention as an atomic element. - self.textarea.replace_range(start_idx..end_idx, ""); - self.textarea.set_cursor(start_idx); - let id = self.textarea.insert_element(insert_text); - - if let (Some(path), Some(mention)) = - (path, Self::mention_name_from_insert_text(insert_text)) - { - self.mention_bindings.insert( - id, - ComposerMentionBinding { - mention, - path: path.to_string(), - }, - ); - } - - self.textarea.insert_str(" "); - let new_cursor = start_idx - .saturating_add(insert_text.len()) - .saturating_add(1); - self.textarea.set_cursor(new_cursor); - } - fn mention_name_from_insert_text(insert_text: &str) -> Option { let name = insert_text.strip_prefix('$')?; if name.is_empty() { @@ -3199,7 +3042,6 @@ impl ChatComposer { } self.active_popup = ActivePopup::None; self.dismissed_file_popup_token = None; - self.dismissed_mention_popup_token = None; return; } if !self.popups_enabled() { @@ -3221,12 +3063,8 @@ impl ChatComposer { self.active_popup = ActivePopup::None; return; } - let mention_token = self.current_mention_token(); - - let allow_command_popup = self.slash_commands_enabled() - && !self.is_bash_mode - && file_token.is_none() - && mention_token.is_none(); + let allow_command_popup = + self.slash_commands_enabled() && !self.is_bash_mode && file_token.is_none(); self.sync_command_popup(allow_command_popup); if matches!(self.active_popup, ActivePopup::Command(_)) { @@ -3236,21 +3074,9 @@ impl ChatComposer { self.current_file_query = None; } self.dismissed_file_popup_token = None; - self.dismissed_mention_popup_token = None; return; } - if let Some(token) = mention_token { - if self.current_file_query.is_some() { - self.app_event_tx - .send(AppEvent::StartFileSearch(String::new())); - self.current_file_query = None; - } - self.sync_mention_popup(token); - return; - } - self.dismissed_mention_popup_token = None; - if let Some(token) = file_token { self.sync_file_search_popup(token); return; @@ -3262,10 +3088,7 @@ impl ChatComposer { self.current_file_query = None; } self.dismissed_file_popup_token = None; - if matches!( - self.active_popup, - ActivePopup::File(_) | ActivePopup::Skill(_) - ) { + if matches!(self.active_popup, ActivePopup::File(_)) { self.active_popup = ActivePopup::None; } } @@ -3482,57 +3305,6 @@ impl ChatComposer { self.dismissed_file_popup_token = None; } - fn sync_mention_popup(&mut self, query: String) { - if self.dismissed_mention_popup_token.as_ref() == Some(&query) { - return; - } - - let mentions = self.mention_items(); - if mentions.is_empty() { - self.active_popup = ActivePopup::None; - return; - } - - match &mut self.active_popup { - ActivePopup::Skill(popup) => { - popup.set_query(&query); - popup.set_mentions(mentions); - } - _ => { - let mut popup = SkillPopup::new(mentions); - popup.set_query(&query); - self.active_popup = ActivePopup::Skill(popup); - } - } - } - - fn mention_items(&self) -> Vec { - let mut mentions = Vec::new(); - if let Some(skills) = self.skills.as_ref() { - for skill in skills { - let display_name = skill_display_name(skill); - let description = skill_description(skill); - let skill_name = skill.name.clone(); - let search_terms = if display_name == skill.name { - vec![skill_name.clone()] - } else { - vec![skill_name.clone(), display_name.clone()] - }; - mentions.push(MentionItem { - display_name, - description, - insert_text: format!("${skill_name}"), - search_terms, - path: Some(skill.path_to_skills_md.to_string_lossy().into_owned()), - category_tag: Some("[Skill]".to_string()), - sort_rank: 1, - }); - } - } - - mentions - } - fn set_has_focus(&mut self, has_focus: bool) { self.has_focus = has_focus; } @@ -3625,17 +3397,6 @@ impl ChatComposer { } } -fn skill_description(skill: &SkillMetadata) -> Option { - let description = skill - .interface - .as_ref() - .and_then(|interface| interface.short_description.as_deref()) - .or(skill.short_description.as_deref()) - .unwrap_or(&skill.description); - let trimmed = description.trim(); - (!trimmed.is_empty()).then(|| trimmed.to_string()) -} - fn is_mention_name_char(byte: u8) -> bool { matches!(byte, b'a'..=b'z' | b'A'..=b'Z' | b'0'..=b'9' | b'_' | b'-') } @@ -3714,7 +3475,6 @@ impl Renderable for ChatComposer { ActivePopup::None => footer_total_height, ActivePopup::Command(c) => c.calculate_required_height(width), ActivePopup::File(c) => c.calculate_required_height(), - ActivePopup::Skill(c) => c.calculate_required_height(width), } } @@ -3734,9 +3494,6 @@ impl ChatComposer { ActivePopup::File(popup) => { popup.render_ref(popup_rect, buf); } - ActivePopup::Skill(popup) => { - popup.render_ref(popup_rect, buf); - } ActivePopup::None => { let footer_props = self.footer_props(); let show_cycle_hint = @@ -5108,41 +4865,6 @@ mod tests { assert_ne!(composer.footer_mode, FooterMode::ShortcutOverlay); } #[test] - fn set_skill_mentions_refreshes_open_mention_popup() { - let (tx, _rx) = unbounded_channel::(); - let sender = AppEventSender::new(tx); - let mut composer = ChatComposer::new( - /*has_input_focus*/ true, - sender, - /*enhanced_keys_supported*/ false, - "Ask Codex to do anything".to_string(), - /*disable_paste_burst*/ false, - ); - composer.set_text_content("$".to_string(), Vec::new(), Vec::new()); - assert!(matches!(composer.active_popup, ActivePopup::None)); - - let skill_path = test_path_buf("/tmp/skill/SKILL.md").abs(); - composer.set_skill_mentions(Some(vec![SkillMetadata { - name: "codex".to_string(), - description: "Primary personal Codex repo skill.".to_string(), - short_description: None, - interface: None, - dependencies: None, - policy: None, - path_to_skills_md: skill_path.clone(), - scope: codex_protocol::protocol::SkillScope::User, - }])); - - let ActivePopup::Skill(popup) = &composer.active_popup else { - panic!("expected mention popup to open after skills update"); - }; - let mention = popup - .selected_mention() - .expect("expected skill mention to be selected"); - assert_eq!(mention.insert_text, "$codex".to_string()); - assert_eq!(mention.path, Some(skill_path.display().to_string())); - } - #[test] fn shortcut_overlay_persists_while_task_running() { use crossterm::event::KeyCode; use crossterm::event::KeyEvent; @@ -7273,7 +6995,7 @@ mod tests { let mention_bindings = vec![MentionBinding { mention: "figma".to_string(), - path: "/tmp/user/figma/SKILL.md".to_string(), + path: "mcp://figma".to_string(), }]; composer.set_text_content_with_mention_bindings( "$figma please".to_string(), diff --git a/vendor/codex/codex-rs/tui/src/bottom_pane/mod.rs b/vendor/codex/codex-rs/tui/src/bottom_pane/mod.rs index 32d35d0f..5c2080c7 100644 --- a/vendor/codex/codex-rs/tui/src/bottom_pane/mod.rs +++ b/vendor/codex/codex-rs/tui/src/bottom_pane/mod.rs @@ -28,7 +28,6 @@ use crate::render::renderable::RenderableItem; use crate::tui::FrameRequester; use bottom_pane_view::BottomPaneView; use bottom_pane_view::ViewCompletion; -use codex_core_skills::model::SkillMetadata; use codex_features::Features; use codex_file_search::FileMatch; use codex_protocol::request_user_input::RequestUserInputEvent; @@ -66,7 +65,7 @@ pub(crate) struct LocalImageAttachment { pub(crate) struct MentionBinding { /// Mention token text without the leading `$`. pub(crate) mention: String, - /// Canonical mention target (for example `mcp://...` or absolute SKILL.md path). + /// Canonical mention target (for example `mcp://...`). pub(crate) path: String, } mod chat_composer; @@ -79,7 +78,6 @@ mod footer; mod list_selection_view; mod memories_settings_view; pub(crate) mod prompt_args; -mod skill_popup; pub(crate) mod slash_commands; pub(crate) use footer::CollaborationModeIndicator; pub(crate) use list_selection_view::SelectionViewParams; @@ -199,7 +197,6 @@ pub(crate) struct BottomPaneParams { pub(crate) placeholder_text: String, pub(crate) disable_paste_burst: bool, pub(crate) animations_enabled: bool, - pub(crate) skills: Option>, } impl BottomPane { @@ -212,7 +209,6 @@ impl BottomPane { placeholder_text, disable_paste_burst, animations_enabled, - skills, } = params; let mut composer = ChatComposer::new( has_input_focus, @@ -222,7 +218,6 @@ impl BottomPane { disable_paste_burst, ); composer.set_frame_requester(frame_requester.clone()); - composer.set_skill_mentions(skills); Self { composer, view_stack: Vec::new(), @@ -243,11 +238,6 @@ impl BottomPane { } } - pub fn set_skills(&mut self, skills: Option>) { - self.composer.set_skill_mentions(skills); - self.request_redraw(); - } - /// Update image-paste behavior for the active composer and repaint immediately. /// /// Callers use this to keep composer affordances aligned with model capabilities. @@ -340,10 +330,6 @@ impl BottomPane { self.status.as_ref() } - pub fn skills(&self) -> Option<&Vec> { - self.composer.skills() - } - #[cfg(test)] pub(crate) fn context_window_percent(&self) -> Option { self.context_window_percent @@ -1264,7 +1250,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }) } @@ -1364,7 +1349,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: true, animations_enabled: true, - skills: Some(Vec::new()), }); pane.push_approval_request(exec_request(), &features); assert_eq!(CancellationEvent::Handled, pane.on_ctrl_c()); @@ -1384,7 +1368,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: true, animations_enabled: true, - skills: Some(Vec::new()), }); pane.insert_str("draft"); @@ -1412,7 +1395,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); // Create an approval modal (active view). @@ -1529,7 +1511,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); // Start a running task so the status indicator is active above the composer. @@ -1596,7 +1577,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); // Begin a task: show initial status. @@ -1623,7 +1603,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); // Activate spinner (status view replaces composer) with no live ring. @@ -1654,7 +1633,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); pane.set_task_running(/*running*/ true); @@ -1677,7 +1655,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); pane.set_task_running(/*running*/ true); @@ -1706,7 +1683,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); pane.set_task_running(/*running*/ true); @@ -1743,7 +1719,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); pane.set_task_running(/*running*/ true); @@ -1775,7 +1750,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); pane.set_task_running(/*running*/ true); @@ -1806,7 +1780,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); pane.set_remote_image_urls(vec![ @@ -1835,7 +1808,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); pane.set_remote_image_urls(vec!["https://example.com/one.png".to_string()]); @@ -1846,53 +1818,6 @@ mod tests { assert!(pane.remote_image_urls().is_empty()); } - #[test] - fn esc_with_skill_popup_does_not_interrupt_task() { - let (tx_raw, mut rx) = unbounded_channel::(); - let tx = AppEventSender::new(tx_raw); - let mut pane = BottomPane::new(BottomPaneParams { - app_event_tx: tx, - frame_requester: FrameRequester::test_dummy(), - has_input_focus: true, - enhanced_keys_supported: false, - placeholder_text: "Ask Codex to do anything".to_string(), - disable_paste_burst: false, - animations_enabled: true, - skills: Some(vec![SkillMetadata { - name: "test-skill".to_string(), - description: "test skill".to_string(), - short_description: None, - interface: None, - dependencies: None, - policy: None, - path_to_skills_md: test_path_buf("/tmp/test-skill/SKILL.md").abs(), - scope: SkillScope::User, - }]), - }); - - pane.set_task_running(/*running*/ true); - - // Repro: a running task + skill popup + Esc should dismiss the popup, not interrupt. - pane.insert_str("$"); - assert!( - pane.composer.popup_active(), - "expected skill popup after typing `$`" - ); - - pane.handle_key_event(KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE)); - - while let Ok(ev) = rx.try_recv() { - assert!( - !matches!(ev, AppEvent::CodexOp(Op::Interrupt)), - "expected Esc to not send Op::Interrupt when dismissing skill popup" - ); - } - assert!( - !pane.composer.popup_active(), - "expected Esc to dismiss skill popup" - ); - } - #[test] fn esc_with_slash_command_popup_does_not_interrupt_task() { let (tx_raw, mut rx) = unbounded_channel::(); @@ -1905,7 +1830,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); pane.set_task_running(/*running*/ true); @@ -1940,7 +1864,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); pane.set_task_running(/*running*/ true); @@ -1976,7 +1899,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); pane.set_task_running(/*running*/ true); @@ -2024,7 +1946,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); pane.set_task_running(/*running*/ true); @@ -2080,7 +2001,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); let on_ctrl_c_calls = Rc::new(Cell::new(0)); @@ -2128,7 +2048,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); let handle_calls = Rc::new(Cell::new(0)); @@ -2206,7 +2125,6 @@ mod tests { placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: true, - skills: Some(Vec::new()), }); pane.set_composer_input_enabled(/*enabled*/ false, /*placeholder*/ None); diff --git a/vendor/codex/codex-rs/tui/src/bottom_pane/skill_popup.rs b/vendor/codex/codex-rs/tui/src/bottom_pane/skill_popup.rs deleted file mode 100644 index a0d42783..00000000 --- a/vendor/codex/codex-rs/tui/src/bottom_pane/skill_popup.rs +++ /dev/null @@ -1,390 +0,0 @@ -use crossterm::event::KeyCode; -use ratatui::buffer::Buffer; -use ratatui::layout::Constraint; -use ratatui::layout::Layout; -use ratatui::layout::Rect; -use ratatui::text::Line; -use ratatui::widgets::Widget; -use ratatui::widgets::WidgetRef; - -use super::popup_consts::MAX_POPUP_ROWS; -use super::scroll_state::ScrollState; -use super::selection_popup_common::GenericDisplayRow; -use super::selection_popup_common::render_rows_single_line; -use crate::key_hint; -use crate::render::Insets; -use crate::render::RectExt; -use crate::text_formatting::truncate_text; -use codex_utils_fuzzy_match::fuzzy_match; - -#[derive(Clone, Debug)] -pub(crate) struct MentionItem { - pub(crate) display_name: String, - pub(crate) description: Option, - pub(crate) insert_text: String, - pub(crate) search_terms: Vec, - pub(crate) path: Option, - pub(crate) category_tag: Option, - pub(crate) sort_rank: u8, -} - -const MENTION_NAME_TRUNCATE_LEN: usize = 28; - -pub(crate) struct SkillPopup { - query: String, - mentions: Vec, - state: ScrollState, -} - -impl SkillPopup { - pub(crate) fn new(mentions: Vec) -> Self { - Self { - query: String::new(), - mentions, - state: ScrollState::new(), - } - } - - pub(crate) fn set_mentions(&mut self, mentions: Vec) { - self.mentions = mentions; - self.clamp_selection(); - } - - pub(crate) fn set_query(&mut self, query: &str) { - self.query = query.to_string(); - self.clamp_selection(); - } - - pub(crate) fn calculate_required_height(&self, _width: u16) -> u16 { - let rows = self.rows_from_matches(self.filtered()); - let visible = rows.len().clamp(1, MAX_POPUP_ROWS); - (visible as u16).saturating_add(2) - } - - pub(crate) fn move_up(&mut self) { - let len = self.filtered_items().len(); - self.state.move_up_wrap(len); - self.state.ensure_visible(len, MAX_POPUP_ROWS.min(len)); - } - - pub(crate) fn move_down(&mut self) { - let len = self.filtered_items().len(); - self.state.move_down_wrap(len); - self.state.ensure_visible(len, MAX_POPUP_ROWS.min(len)); - } - - pub(crate) fn selected_mention(&self) -> Option<&MentionItem> { - let matches = self.filtered_items(); - let idx = self.state.selected_idx?; - let mention_idx = matches.get(idx)?; - self.mentions.get(*mention_idx) - } - - fn clamp_selection(&mut self) { - let len = self.filtered_items().len(); - self.state.clamp_selection(len); - self.state.ensure_visible(len, MAX_POPUP_ROWS.min(len)); - } - - fn filtered_items(&self) -> Vec { - self.filtered().into_iter().map(|(idx, _, _)| idx).collect() - } - - fn rows_from_matches( - &self, - matches: Vec<(usize, Option>, i32)>, - ) -> Vec { - matches - .into_iter() - .map(|(idx, indices, _score)| { - let mention = &self.mentions[idx]; - let name = truncate_text(&mention.display_name, MENTION_NAME_TRUNCATE_LEN); - let description = match ( - mention.category_tag.as_deref(), - mention.description.as_deref(), - ) { - (Some(tag), Some(description)) if !description.is_empty() => { - Some(format!("{tag} {description}")) - } - (Some(tag), _) => Some(tag.to_string()), - (None, Some(description)) if !description.is_empty() => { - Some(description.to_string()) - } - _ => None, - }; - GenericDisplayRow { - name, - name_prefix_spans: Vec::new(), - match_indices: indices, - display_shortcut: None, - description, - category_tag: None, - is_disabled: false, - disabled_reason: None, - wrap_indent: None, - } - }) - .collect() - } - - fn filtered(&self) -> Vec<(usize, Option>, i32)> { - let filter = self.query.trim(); - let mut out: Vec<(usize, Option>, i32)> = Vec::new(); - - for (idx, mention) in self.mentions.iter().enumerate() { - if filter.is_empty() { - out.push((idx, None, 0)); - continue; - } - - let best_match = - if let Some((indices, score)) = fuzzy_match(&mention.display_name, filter) { - Some((Some(indices), score)) - } else { - mention - .search_terms - .iter() - .filter(|term| *term != &mention.display_name) - .filter_map(|term| fuzzy_match(term, filter).map(|(_indices, score)| score)) - .min() - .map(|score| (None, score)) - }; - - if let Some((indices, score)) = best_match { - out.push((idx, indices, score)); - } - } - - out.sort_by(|a, b| { - if filter.is_empty() { - self.mentions[a.0] - .sort_rank - .cmp(&self.mentions[b.0].sort_rank) - } else { - a.1.is_none() - .cmp(&b.1.is_none()) - .then_with(|| a.2.cmp(&b.2)) - .then_with(|| { - self.mentions[a.0] - .sort_rank - .cmp(&self.mentions[b.0].sort_rank) - }) - } - .then_with(|| { - let an = self.mentions[a.0].display_name.as_str(); - let bn = self.mentions[b.0].display_name.as_str(); - an.cmp(bn) - }) - }); - - out - } -} - -impl WidgetRef for SkillPopup { - fn render_ref(&self, area: Rect, buf: &mut Buffer) { - let (list_area, hint_area) = if area.height > 2 { - let [list_area, _spacer_area, hint_area] = Layout::vertical([ - Constraint::Length(area.height - 2), - Constraint::Length(1), - Constraint::Length(1), - ]) - .areas(area); - (list_area, Some(hint_area)) - } else { - (area, None) - }; - let rows = self.rows_from_matches(self.filtered()); - render_rows_single_line( - list_area.inset(Insets::tlbr( - /*top*/ 0, /*left*/ 2, /*bottom*/ 0, /*right*/ 0, - )), - buf, - &rows, - &self.state, - MAX_POPUP_ROWS, - "no matches", - ); - if let Some(hint_area) = hint_area { - let hint_area = Rect { - x: hint_area.x + 2, - y: hint_area.y, - width: hint_area.width.saturating_sub(2), - height: hint_area.height, - }; - skill_popup_hint_line().render(hint_area, buf); - } - } -} - -fn skill_popup_hint_line() -> Line<'static> { - Line::from(vec![ - "Press ".into(), - key_hint::plain(KeyCode::Enter).into(), - " to insert or ".into(), - key_hint::plain(KeyCode::Esc).into(), - " to close".into(), - ]) -} - -#[cfg(test)] -mod tests { - use super::*; - use pretty_assertions::assert_eq; - use ratatui::buffer::Buffer; - use ratatui::layout::Rect; - - fn mention_item(index: usize) -> MentionItem { - MentionItem { - display_name: format!("Mention {index:02}"), - description: Some(format!("Description {index:02}")), - insert_text: format!("$mention-{index:02}"), - search_terms: vec![format!("mention-{index:02}")], - path: Some(format!("skill://mention-{index:02}")), - category_tag: Some("[Skill]".to_string()), - sort_rank: 1, - } - } - - fn ranked_mention_item( - display_name: &str, - search_terms: &[&str], - category_tag: &str, - sort_rank: u8, - ) -> MentionItem { - MentionItem { - display_name: display_name.to_string(), - description: None, - insert_text: format!("${display_name}"), - search_terms: search_terms - .iter() - .map(|term| (*term).to_string()) - .collect(), - path: None, - category_tag: Some(category_tag.to_string()), - sort_rank, - } - } - - fn named_mention_item(display_name: &str, search_terms: &[&str]) -> MentionItem { - ranked_mention_item(display_name, search_terms, "[Skill]", /*sort_rank*/ 1) - } - - fn plugin_mention_item(display_name: &str, search_terms: &[&str]) -> MentionItem { - ranked_mention_item(display_name, search_terms, "[Plugin]", /*sort_rank*/ 0) - } - - #[test] - fn filtered_mentions_preserve_results_beyond_popup_height() { - let popup = SkillPopup::new((0..(MAX_POPUP_ROWS + 2)).map(mention_item).collect()); - - let filtered_names: Vec = popup - .filtered_items() - .into_iter() - .map(|idx| popup.mentions[idx].display_name.clone()) - .collect(); - - assert_eq!( - filtered_names, - (0..(MAX_POPUP_ROWS + 2)) - .map(|idx| format!("Mention {idx:02}")) - .collect::>() - ); - assert_eq!( - popup.calculate_required_height(72), - (MAX_POPUP_ROWS as u16) + 2 - ); - } - - fn render_popup(popup: &SkillPopup, width: u16) -> String { - let area = Rect::new(0, 0, width, popup.calculate_required_height(width)); - let mut buf = Buffer::empty(area); - popup.render_ref(area, &mut buf); - format!("{buf:?}") - } - - #[test] - fn scrolling_mentions_shifts_rendered_window_snapshot() { - let mut popup = SkillPopup::new((0..(MAX_POPUP_ROWS + 2)).map(mention_item).collect()); - - for _ in 0..=MAX_POPUP_ROWS { - popup.move_down(); - } - - insta::assert_snapshot!("skill_popup_scrolled", render_popup(&popup, /*width*/ 72)); - } - - #[test] - fn display_name_match_sorting_beats_worse_secondary_search_term_matches() { - let mut popup = SkillPopup::new(vec![ - named_mention_item("pr-review-triage", &["pr-review-triage"]), - named_mention_item("prd", &["prd"]), - named_mention_item("PR Babysitter", &["babysit-pr", "PR Babysitter"]), - named_mention_item("Plugin Creator", &["plugin-creator", "Plugin Creator"]), - named_mention_item( - "Logging Best Practices", - &["logging-best-practices", "Logging Best Practices"], - ), - ]); - popup.set_query("pr"); - - let filtered_names: Vec = popup - .filtered_items() - .into_iter() - .map(|idx| popup.mentions[idx].display_name.clone()) - .collect(); - - assert_eq!( - filtered_names, - vec![ - "PR Babysitter".to_string(), - "pr-review-triage".to_string(), - "prd".to_string(), - "Plugin Creator".to_string(), - "Logging Best Practices".to_string(), - ] - ); - } - - #[test] - fn query_match_score_sorts_before_plugin_rank_bias() { - let mut popup = SkillPopup::new(vec![ - plugin_mention_item("GitHub", &["github", "pull requests", "pr"]), - named_mention_item("pr-review-triage", &["pr-review-triage"]), - named_mention_item("prd", &["prd"]), - named_mention_item("Plugin Creator", &["plugin-creator", "Plugin Creator"]), - named_mention_item( - "Logging Best Practices", - &["logging-best-practices", "Logging Best Practices"], - ), - named_mention_item("PR Babysitter", &["babysit-pr", "PR Babysitter"]), - ]); - popup.set_query("pr"); - - let filtered_items: Vec<(String, Option)> = popup - .filtered_items() - .into_iter() - .map(|idx| { - ( - popup.mentions[idx].display_name.clone(), - popup.mentions[idx].category_tag.clone(), - ) - }) - .collect(); - - assert_eq!( - filtered_items, - vec![ - ("PR Babysitter".to_string(), Some("[Skill]".to_string())), - ("pr-review-triage".to_string(), Some("[Skill]".to_string())), - ("prd".to_string(), Some("[Skill]".to_string())), - ("Plugin Creator".to_string(), Some("[Skill]".to_string())), - ( - "Logging Best Practices".to_string(), - Some("[Skill]".to_string()) - ), - ("GitHub".to_string(), Some("[Plugin]".to_string())), - ] - ); - } -} diff --git a/vendor/codex/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__skill_popup__tests__skill_popup_scrolled.snap b/vendor/codex/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__skill_popup__tests__skill_popup_scrolled.snap deleted file mode 100644 index 00789ead..00000000 --- a/vendor/codex/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__skill_popup__tests__skill_popup_scrolled.snap +++ /dev/null @@ -1,43 +0,0 @@ ---- -source: tui/src/bottom_pane/skill_popup.rs -assertion_line: 289 -expression: "render_popup(&popup, /*width*/ 72)" ---- -Buffer { - area: Rect { x: 0, y: 0, width: 72, height: 10 }, - content: [ - " Mention 01 [Skill] Description 01 ", - " Mention 02 [Skill] Description 02 ", - " Mention 03 [Skill] Description 03 ", - " Mention 04 [Skill] Description 04 ", - " Mention 05 [Skill] Description 05 ", - " Mention 06 [Skill] Description 06 ", - " Mention 07 [Skill] Description 07 ", - " Mention 08 [Skill] Description 08 ", - " ", - " Press enter to insert or esc to close ", - ], - styles: [ - x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE, - x: 14, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: DIM, - x: 36, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE, - x: 14, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM, - x: 36, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE, - x: 14, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: DIM, - x: 36, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: NONE, - x: 14, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: DIM, - x: 36, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: NONE, - x: 14, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: DIM, - x: 36, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: NONE, - x: 14, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: DIM, - x: 36, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: NONE, - x: 14, y: 6, fg: Reset, bg: Reset, underline: Reset, modifier: DIM, - x: 36, y: 6, fg: Reset, bg: Reset, underline: Reset, modifier: NONE, - x: 2, y: 7, fg: Cyan, bg: Reset, underline: Reset, modifier: BOLD, - x: 36, y: 7, fg: Reset, bg: Reset, underline: Reset, modifier: NONE, - x: 8, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM, - x: 13, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: NONE, - x: 27, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM, - x: 30, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: NONE, - ] -} diff --git a/vendor/codex/codex-rs/tui/src/chatwidget.rs b/vendor/codex/codex-rs/tui/src/chatwidget.rs index cac03a22..5c8e23bb 100644 --- a/vendor/codex/codex-rs/tui/src/chatwidget.rs +++ b/vendor/codex/codex-rs/tui/src/chatwidget.rs @@ -108,7 +108,6 @@ use codex_config::ConfigLayerStackOrdering; use codex_config::types::ApprovalsReviewer; use codex_config::types::Notifications; use codex_config::types::WindowsSandboxModeToml; -use codex_core_skills::model::SkillMetadata; use codex_features::FEATURES; use codex_features::Feature; #[cfg(test)] @@ -195,7 +194,6 @@ use codex_protocol::protocol::RateLimitReachedType; use codex_protocol::protocol::RateLimitSnapshot; use codex_protocol::protocol::ReviewRequest; use codex_protocol::protocol::ReviewTarget; -use codex_protocol::protocol::SkillMetadata as ProtocolSkillMetadata; #[cfg(test)] use codex_protocol::protocol::StreamErrorEvent; use codex_protocol::protocol::TerminalInteractionEvent; @@ -359,11 +357,8 @@ mod interrupts; use self::interrupts::InterruptManager; mod session_header; use self::session_header::SessionHeader; -mod skills; -mod slash_dispatch; -use self::skills::collect_tool_mentions; -use self::skills::find_skill_mentions_with_tool_mentions; mod plan_implementation; +mod slash_dispatch; use self::plan_implementation::PLAN_IMPLEMENTATION_TITLE; mod realtime; use self::realtime::RealtimeConversationUiState; @@ -799,7 +794,6 @@ pub(crate) struct ChatWidget { collab_agent_metadata: HashMap, pending_collab_spawn_requests: HashMap, suppressed_exec_calls: HashSet, - skills_all: Vec, last_unified_wait: Option, unified_exec_wait_streak: Option, turn_sleep_inhibitor: SleepInhibitor, @@ -2069,7 +2063,6 @@ impl ChatWidget { self.saw_copy_source_this_turn = false; self.bottom_pane .set_history_metadata(event.history_log_id, event.history_entry_count); - self.set_skills(/*skills*/ None); self.session_network_proxy = event.network_proxy.clone(); self.thread_id = Some(event.session_id); self.last_turn_id = None; @@ -2246,10 +2239,6 @@ impl ChatWidget { } } - fn set_skills(&mut self, skills: Option>) { - self.bottom_pane.set_skills(skills); - } - pub(crate) fn open_feedback_note( &mut self, category: crate::app_event::FeedbackCategory, @@ -4658,7 +4647,6 @@ impl ChatWidget { Some(rc) => (rc.command, rc.parsed_cmd, rc.source), None => (ev.command.clone(), ev.parsed_cmd.clone(), ev.source), }; - let parsed = self.annotate_skill_reads_in_parsed_cmd(parsed); let is_unified_exec_interaction = matches!(source, ExecCommandSource::UnifiedExecInteraction); let is_user_shell = source == ExecCommandSource::UserShell; @@ -4886,7 +4874,7 @@ impl ChatWidget { pub(crate) fn handle_exec_begin_now(&mut self, ev: ExecCommandBeginEvent) { // Ensure the status indicator is visible while the command runs. self.bottom_pane.ensure_status_indicator(); - let parsed_cmd = self.annotate_skill_reads_in_parsed_cmd(ev.parsed_cmd.clone()); + let parsed_cmd = ev.parsed_cmd.clone(); self.running_commands.insert( ev.call_id.clone(), RunningCommand { @@ -5066,12 +5054,10 @@ impl ChatWidget { placeholder_text: placeholder.clone(), disable_paste_burst: config.disable_paste_burst, animations_enabled: config.animations, - skills: None, }), active_cell, active_cell_revision: 0, config, - skills_all: Vec::new(), current_collaboration_mode, active_collaboration_mask, has_chatgpt_account, @@ -5740,45 +5726,6 @@ impl ChatWidget { }); } - let mentions = collect_tool_mentions(&text, &HashMap::new()); - let bound_names: HashSet = mention_bindings - .iter() - .map(|binding| binding.mention.clone()) - .collect(); - let mut selected_skill_paths: HashSet = HashSet::new(); - if let Some(skills) = self.bottom_pane.skills() { - for binding in &mention_bindings { - let path = binding - .path - .strip_prefix("skill://") - .unwrap_or(binding.path.as_str()); - let path = Path::new(path); - if let Some(skill) = skills - .iter() - .find(|skill| skill.path_to_skills_md.as_path() == path) - && selected_skill_paths.insert(skill.path_to_skills_md.clone()) - { - items.push(UserInput::Skill { - name: skill.name.clone(), - path: skill.path_to_skills_md.to_path_buf(), - }); - } - } - - let skill_mentions = find_skill_mentions_with_tool_mentions(&mentions, skills); - for skill in skill_mentions { - if bound_names.contains(skill.name.as_str()) - || !selected_skill_paths.insert(skill.path_to_skills_md.clone()) - { - continue; - } - items.push(UserInput::Skill { - name: skill.name.clone(), - path: skill.path_to_skills_md.to_path_buf(), - }); - } - } - let effective_mode = self.effective_collaboration_mode(); if effective_mode.model().trim().is_empty() { self.add_error_message( diff --git a/vendor/codex/codex-rs/tui/src/chatwidget/realtime.rs b/vendor/codex/codex-rs/tui/src/chatwidget/realtime.rs index bfeaff2e..b3a2192b 100644 --- a/vendor/codex/codex-rs/tui/src/chatwidget/realtime.rs +++ b/vendor/codex/codex-rs/tui/src/chatwidget/realtime.rs @@ -121,7 +121,7 @@ impl ChatWidget { match item { UserInput::Text { text, .. } => message.push_str(text), UserInput::Image { .. } | UserInput::LocalImage { .. } => image_count += 1, - UserInput::Skill { .. } | UserInput::Mention { .. } => {} + UserInput::Mention { .. } => {} _ => {} } } @@ -165,7 +165,7 @@ impl ChatWidget { ), UserInput::Image { image_url } => remote_image_urls.push(image_url.clone()), UserInput::LocalImage { path } => local_images.push(path.clone()), - UserInput::Skill { .. } | UserInput::Mention { .. } => {} + UserInput::Mention { .. } => {} _ => {} } } diff --git a/vendor/codex/codex-rs/tui/src/chatwidget/skills.rs b/vendor/codex/codex-rs/tui/src/chatwidget/skills.rs deleted file mode 100644 index f4d0ed05..00000000 --- a/vendor/codex/codex-rs/tui/src/chatwidget/skills.rs +++ /dev/null @@ -1,252 +0,0 @@ -use std::collections::HashMap; -use std::collections::HashSet; - -use super::ChatWidget; -use codex_core_skills::model::SkillMetadata; -use codex_protocol::parse_command::ParsedCommand; - -const TOOL_MENTION_SIGIL: char = '$'; - -impl ChatWidget { - pub(crate) fn annotate_skill_reads_in_parsed_cmd( - &self, - mut parsed_cmd: Vec, - ) -> Vec { - if self.skills_all.is_empty() { - return parsed_cmd; - } - - for parsed in &mut parsed_cmd { - let ParsedCommand::Read { name, path, .. } = parsed else { - continue; - }; - if name != "SKILL.md" { - continue; - } - - // Best effort only: annotate exact SKILL.md path matches from the loaded skills list. - if let Some(skill) = self - .skills_all - .iter() - .find(|skill| skill.path.as_path() == path) - { - *name = format!("{name} ({} skill)", skill.name); - } - } - - parsed_cmd - } -} - -pub(crate) fn collect_tool_mentions( - text: &str, - mention_paths: &HashMap, -) -> ToolMentions { - let mut mentions = extract_tool_mentions_from_text(text); - for (name, path) in mention_paths { - if mentions.names.contains(name) { - mentions.linked_paths.insert(name.clone(), path.clone()); - } - } - mentions -} - -pub(crate) fn find_skill_mentions_with_tool_mentions( - mentions: &ToolMentions, - skills: &[SkillMetadata], -) -> Vec { - let mention_skill_paths: HashSet<&str> = mentions - .linked_paths - .values() - .filter(|path| is_skill_path(path)) - .map(|path| normalize_skill_path(path)) - .collect(); - - let mut seen_names = HashSet::new(); - let mut seen_paths = HashSet::new(); - let mut matches: Vec = Vec::new(); - - for skill in skills { - if seen_paths.contains(&skill.path_to_skills_md) { - continue; - } - let path_str = skill.path_to_skills_md.to_string_lossy(); - if mention_skill_paths.contains(path_str.as_ref()) { - seen_paths.insert(skill.path_to_skills_md.clone()); - seen_names.insert(skill.name.clone()); - matches.push(skill.clone()); - } - } - - for skill in skills { - if seen_paths.contains(&skill.path_to_skills_md) { - continue; - } - if mentions.names.contains(&skill.name) && seen_names.insert(skill.name.clone()) { - seen_paths.insert(skill.path_to_skills_md.clone()); - matches.push(skill.clone()); - } - } - - matches -} - -pub(crate) struct ToolMentions { - names: HashSet, - linked_paths: HashMap, -} - -fn extract_tool_mentions_from_text(text: &str) -> ToolMentions { - extract_tool_mentions_from_text_with_sigil(text, TOOL_MENTION_SIGIL) -} - -fn extract_tool_mentions_from_text_with_sigil(text: &str, sigil: char) -> ToolMentions { - let text_bytes = text.as_bytes(); - let mut names: HashSet = HashSet::new(); - let mut linked_paths: HashMap = HashMap::new(); - - let mut index = 0; - while index < text_bytes.len() { - let byte = text_bytes[index]; - if byte == b'[' - && let Some((name, path, end_index)) = - parse_linked_tool_mention(text, text_bytes, index, sigil) - { - if !is_common_env_var(name) { - if is_skill_path(path) { - names.insert(name.to_string()); - } - linked_paths - .entry(name.to_string()) - .or_insert(path.to_string()); - } - index = end_index; - continue; - } - - if byte != sigil as u8 { - index += 1; - continue; - } - - let name_start = index + 1; - let Some(first_name_byte) = text_bytes.get(name_start) else { - index += 1; - continue; - }; - if !is_mention_name_char(*first_name_byte) { - index += 1; - continue; - } - - let mut name_end = name_start + 1; - while let Some(next_byte) = text_bytes.get(name_end) - && is_mention_name_char(*next_byte) - { - name_end += 1; - } - - let name = &text[name_start..name_end]; - if !is_common_env_var(name) { - names.insert(name.to_string()); - } - index = name_end; - } - - ToolMentions { - names, - linked_paths, - } -} - -fn parse_linked_tool_mention<'a>( - text: &'a str, - text_bytes: &[u8], - start: usize, - sigil: char, -) -> Option<(&'a str, &'a str, usize)> { - let sigil_index = start + 1; - if text_bytes.get(sigil_index) != Some(&(sigil as u8)) { - return None; - } - - let name_start = sigil_index + 1; - let first_name_byte = text_bytes.get(name_start)?; - if !is_mention_name_char(*first_name_byte) { - return None; - } - - let mut name_end = name_start + 1; - while let Some(next_byte) = text_bytes.get(name_end) - && is_mention_name_char(*next_byte) - { - name_end += 1; - } - - if text_bytes.get(name_end) != Some(&b']') { - return None; - } - - let mut path_start = name_end + 1; - while let Some(next_byte) = text_bytes.get(path_start) - && next_byte.is_ascii_whitespace() - { - path_start += 1; - } - if text_bytes.get(path_start) != Some(&b'(') { - return None; - } - - let mut path_end = path_start + 1; - while let Some(next_byte) = text_bytes.get(path_end) - && *next_byte != b')' - { - path_end += 1; - } - if text_bytes.get(path_end) != Some(&b')') { - return None; - } - - let path = text[path_start + 1..path_end].trim(); - if path.is_empty() { - return None; - } - - let name = &text[name_start..name_end]; - Some((name, path, path_end + 1)) -} - -fn is_common_env_var(name: &str) -> bool { - let upper = name.to_ascii_uppercase(); - matches!( - upper.as_str(), - "PATH" - | "HOME" - | "USER" - | "SHELL" - | "PWD" - | "TMPDIR" - | "TEMP" - | "TMP" - | "LANG" - | "TERM" - | "XDG_CONFIG_HOME" - ) -} - -fn is_mention_name_char(byte: u8) -> bool { - matches!(byte, b'a'..=b'z' | b'A'..=b'Z' | b'0'..=b'9' | b'_' | b'-') -} - -fn is_skill_path(path: &str) -> bool { - path.starts_with("skill://") - || (!path.contains("://") - && path - .rsplit(['/', '\\']) - .next() - .is_some_and(|name| name.eq_ignore_ascii_case("SKILL.md"))) -} - -fn normalize_skill_path(path: &str) -> &str { - path.strip_prefix("skill://").unwrap_or(path) -} diff --git a/vendor/codex/codex-rs/tui/src/chatwidget/tests.rs b/vendor/codex/codex-rs/tui/src/chatwidget/tests.rs index 270d9e45..8f29db5d 100644 --- a/vendor/codex/codex-rs/tui/src/chatwidget/tests.rs +++ b/vendor/codex/codex-rs/tui/src/chatwidget/tests.rs @@ -91,7 +91,6 @@ pub(super) use codex_config::types::ApprovalsReviewer; pub(super) use codex_config::types::Notifications; #[cfg(target_os = "windows")] pub(super) use codex_config::types::WindowsSandboxModeToml; -pub(super) use codex_core_skills::model::SkillMetadata; pub(super) use codex_features::FEATURES; pub(super) use codex_features::Feature; pub(super) use codex_git_utils::CommitLogEntry; @@ -172,7 +171,6 @@ pub(super) use codex_protocol::protocol::ReviewRequest; pub(super) use codex_protocol::protocol::ReviewTarget; pub(super) use codex_protocol::protocol::SessionConfiguredEvent; pub(super) use codex_protocol::protocol::SessionSource; -pub(super) use codex_protocol::protocol::SkillScope; pub(super) use codex_protocol::protocol::StreamErrorEvent; pub(super) use codex_protocol::protocol::TerminalInteractionEvent; pub(super) use codex_protocol::protocol::ThreadRolledBackEvent; diff --git a/vendor/codex/codex-rs/tui/src/chatwidget/tests/composer_submission.rs b/vendor/codex/codex-rs/tui/src/chatwidget/tests/composer_submission.rs index 778b6d60..f700cdad 100644 --- a/vendor/codex/codex-rs/tui/src/chatwidget/tests/composer_submission.rs +++ b/vendor/codex/codex-rs/tui/src/chatwidget/tests/composer_submission.rs @@ -368,86 +368,6 @@ async fn enter_with_only_remote_images_does_not_submit_when_input_disabled() { assert_no_submit_op(&mut op_rx); } -#[tokio::test] -async fn submission_prefers_selected_duplicate_skill_path() { - let (mut chat, mut rx, mut op_rx) = make_chatwidget_manual(/*model_override*/ None).await; - - let conversation_id = ThreadId::new(); - let rollout_file = NamedTempFile::new().unwrap(); - let configured = codex_protocol::protocol::SessionConfiguredEvent { - session_id: conversation_id, - forked_from_id: None, - thread_name: None, - model: "test-model".to_string(), - model_provider_id: "test-provider".to_string(), - service_tier: None, - approval_policy: AskForApproval::Never, - approvals_reviewer: ApprovalsReviewer::User, - sandbox_policy: SandboxPolicy::new_read_only_policy(), - cwd: test_path_buf("/home/user/project").abs(), - reasoning_effort: Some(ReasoningEffortConfig::default()), - history_log_id: 0, - history_entry_count: 0, - initial_messages: None, - network_proxy: None, - rollout_path: Some(rollout_file.path().to_path_buf()), - }; - chat.handle_codex_event(Event { - id: "initial".into(), - msg: EventMsg::SessionConfigured(configured), - }); - drain_insert_history(&mut rx); - - let repo_skill_path = test_path_buf("/tmp/repo/figma/SKILL.md").abs(); - let user_skill_path = test_path_buf("/tmp/user/figma/SKILL.md").abs(); - chat.set_skills(Some(vec![ - SkillMetadata { - name: "figma".to_string(), - description: "Repo skill".to_string(), - short_description: None, - interface: None, - dependencies: None, - policy: None, - path_to_skills_md: repo_skill_path, - scope: SkillScope::Repo, - }, - SkillMetadata { - name: "figma".to_string(), - description: "User skill".to_string(), - short_description: None, - interface: None, - dependencies: None, - policy: None, - path_to_skills_md: user_skill_path.clone(), - scope: SkillScope::User, - }, - ])); - - chat.bottom_pane.set_composer_text_with_mention_bindings( - "please use $figma now".to_string(), - Vec::new(), - Vec::new(), - vec![MentionBinding { - mention: "figma".to_string(), - path: user_skill_path.to_string_lossy().into_owned(), - }], - ); - chat.handle_key_event(KeyEvent::new(KeyCode::Enter, KeyModifiers::NONE)); - - let items = match next_submit_op(&mut op_rx) { - Op::UserTurn { items, .. } => items, - other => panic!("expected Op::UserTurn, got {other:?}"), - }; - let selected_skill_paths = items - .iter() - .filter_map(|item| match item { - UserInput::Skill { path, .. } => Some(path.clone()), - _ => None, - }) - .collect::>(); - assert_eq!(selected_skill_paths, vec![user_skill_path.to_path_buf()]); -} - #[tokio::test] async fn blocked_image_restore_preserves_mention_bindings() { let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await; @@ -464,7 +384,7 @@ async fn blocked_image_restore_preserves_mention_bindings() { }]; let mention_bindings = vec![MentionBinding { mention: "file".to_string(), - path: "/tmp/skills/file/SKILL.md".to_string(), + path: "mcp://file".to_string(), }]; chat.restore_blocked_image_submission( @@ -998,10 +918,6 @@ fn rendered_user_message_event_from_inputs_matches_flattened_user_message_shape( UserInput::LocalImage { path: local_image.clone(), }, - UserInput::Skill { - name: "demo".to_string(), - path: PathBuf::from("/tmp/skill/SKILL.md"), - }, UserInput::Mention { name: "repo".to_string(), path: "mcp://repo".to_string(), diff --git a/vendor/codex/codex-rs/tui/src/chatwidget/tests/helpers.rs b/vendor/codex/codex-rs/tui/src/chatwidget/tests/helpers.rs index 2ec32ac4..447fb441 100644 --- a/vendor/codex/codex-rs/tui/src/chatwidget/tests/helpers.rs +++ b/vendor/codex/codex-rs/tui/src/chatwidget/tests/helpers.rs @@ -166,7 +166,6 @@ pub(super) async fn make_chatwidget_manual( placeholder_text: "Ask Codex to do anything".to_string(), disable_paste_burst: false, animations_enabled: cfg.animations, - skills: None, }); bottom.set_collaboration_modes_enabled(/*enabled*/ true); let model_catalog = test_model_catalog(&cfg); @@ -221,7 +220,6 @@ pub(super) async fn make_chatwidget_manual( collab_agent_metadata: HashMap::new(), pending_collab_spawn_requests: HashMap::new(), suppressed_exec_calls: HashSet::new(), - skills_all: Vec::new(), last_unified_wait: None, unified_exec_wait_streak: None, turn_sleep_inhibitor: SleepInhibitor::new(prevent_idle_sleep), diff --git a/vendor/codex/codex-rs/tui/src/chatwidget/tests/plan_mode.rs b/vendor/codex/codex-rs/tui/src/chatwidget/tests/plan_mode.rs index 7f386e66..ccc93947 100644 --- a/vendor/codex/codex-rs/tui/src/chatwidget/tests/plan_mode.rs +++ b/vendor/codex/codex-rs/tui/src/chatwidget/tests/plan_mode.rs @@ -1080,7 +1080,7 @@ async fn submit_user_message_ignores_plugin_mentions_from_bindings() { text_elements: Vec::new(), mention_bindings: vec![MentionBinding { mention: "sample".to_string(), - path: "skill://sample".to_string(), + path: "mcp://sample".to_string(), }], }); diff --git a/vendor/codex/codex-rs/tui/src/chatwidget/tests/review_mode.rs b/vendor/codex/codex-rs/tui/src/chatwidget/tests/review_mode.rs index 86bd4a26..8b105b0c 100644 --- a/vendor/codex/codex-rs/tui/src/chatwidget/tests/review_mode.rs +++ b/vendor/codex/codex-rs/tui/src/chatwidget/tests/review_mode.rs @@ -911,7 +911,7 @@ async fn manual_interrupt_restores_pending_steer_mention_bindings_to_composer() let mention_bindings = vec![MentionBinding { mention: "figma".to_string(), - path: "/tmp/skills/figma/SKILL.md".to_string(), + path: "mcp://figma".to_string(), }]; chat.bottom_pane.set_composer_text_with_mention_bindings( "please use $figma".to_string(), diff --git a/vendor/codex/codex-rs/tui/src/lib.rs b/vendor/codex/codex-rs/tui/src/lib.rs index 2e53de4c..026702cb 100644 --- a/vendor/codex/codex-rs/tui/src/lib.rs +++ b/vendor/codex/codex-rs/tui/src/lib.rs @@ -148,7 +148,6 @@ mod resume_picker; mod selection_list; mod session_log; mod shimmer; -mod skills_helpers; mod slash_command; mod status; mod status_indicator_widget; diff --git a/vendor/codex/codex-rs/tui/src/mention_codec.rs b/vendor/codex/codex-rs/tui/src/mention_codec.rs index 078087fa..7e50cd5a 100644 --- a/vendor/codex/codex-rs/tui/src/mention_codec.rs +++ b/vendor/codex/codex-rs/tui/src/mention_codec.rs @@ -200,11 +200,6 @@ fn is_common_env_var(name: &str) -> bool { fn is_tool_path(path: &str) -> bool { path.starts_with("mcp://") - || path.starts_with("skill://") - || path - .rsplit(['/', '\\']) - .next() - .is_some_and(|name| name.eq_ignore_ascii_case("SKILL.md")) } #[cfg(test)] @@ -214,10 +209,8 @@ mod tests { #[test] fn decode_history_mentions_restores_visible_tokens() { - let decoded = decode_history_mentions( - "Use [$repo](mcp://repo), [$sample](skill://sample), and [$figma](/tmp/figma/SKILL.md).", - ); - assert_eq!(decoded.text, "Use $repo, $sample, and $figma."); + let decoded = decode_history_mentions("Use [$repo](mcp://repo) and [$figma](mcp://figma)."); + assert_eq!(decoded.text, "Use $repo and $figma."); assert_eq!( decoded.mentions, vec![ @@ -225,13 +218,9 @@ mod tests { mention: "repo".to_string(), path: "mcp://repo".to_string(), }, - LinkedMention { - mention: "sample".to_string(), - path: "skill://sample".to_string(), - }, LinkedMention { mention: "figma".to_string(), - path: "/tmp/figma/SKILL.md".to_string(), + path: "mcp://figma".to_string(), }, ] ); @@ -257,17 +246,17 @@ mod tests { }, LinkedMention { mention: "sample".to_string(), - path: "skill://sample".to_string(), + path: "mcp://sample".to_string(), }, LinkedMention { mention: "figma".to_string(), - path: "/tmp/figma/SKILL.md".to_string(), + path: "mcp://figma-alt".to_string(), }, ], ); assert_eq!( encoded, - "[$figma](mcp://figma) then [$sample](skill://sample) then [$figma](/tmp/figma/SKILL.md) then $other" + "[$figma](mcp://figma) then [$sample](mcp://sample) then [$figma](mcp://figma-alt) then $other" ); } } diff --git a/vendor/codex/codex-rs/tui/src/skills_helpers.rs b/vendor/codex/codex-rs/tui/src/skills_helpers.rs deleted file mode 100644 index 5403ffc2..00000000 --- a/vendor/codex/codex-rs/tui/src/skills_helpers.rs +++ /dev/null @@ -1,20 +0,0 @@ -use codex_core_skills::model::SkillMetadata; - -pub(crate) fn skill_display_name(skill: &SkillMetadata) -> String { - if let Some(display_name) = skill - .interface - .as_ref() - .and_then(|interface| interface.display_name.as_deref()) - { - return display_name.to_string(); - } - - if let Some((plugin_name, skill_name)) = skill.name.split_once(':') - && !plugin_name.is_empty() - && !skill_name.is_empty() - { - return format!("{skill_name} ({plugin_name})"); - } - - skill.name.clone() -}