Commit Graph

3 Commits

Author SHA1 Message Date
Michael Jolley
47c7b60586 Parse nested moreCommands on context items in JS host mapper
ParseContextItem only read title/command/icon and dropped any nested moreCommands array, so JS/TS extensions could not surface nested context-menu commands even when the wire carried them. Recursively parse the moreCommands array (reusing ParseContextItems) and assign the children onto the existing CommandContextItem.MoreCommands, leaving the default empty array when the field is absent.

Pairs with the Phase 1 SDK serialization change (8f123a8616).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8e96286c-f6eb-42d5-bcd3-68fc6a76622f
2026-08-28 13:06:18 -05:00
Michael Jolley
0302d0efbf Address Phase 3 review: wire shapes and thread safety
- Filter separators read the SDK "separator" flag instead of "_isSeparator"
  (list-item separators still use "_isSeparator" per the SDK serializer).
- Grid layout reads the SDK "type" discriminator instead of "layout".
- fallback/updateQuery is sent as a request, matching the protocol and SDK.
- Scope listPage/itemsChanged routing per connection via a ConditionalWeakTable
  keyed by the JsonRpcConnection, holding proxies as weak references so ids from
  different extensions no longer collide and collected proxies are pruned.
- Use a ConcurrentDictionary for the fallback adapter map shared between the
  request path and the JSON-RPC reader thread.
- Add tests covering filter separators, grid type, and fallback updateQuery.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f9b90e37-dcfc-4ea7-8a79-87eb2af072b6
2026-08-28 13:06:18 -05:00
Michael Jolley
b296d05700 CmdPal JS/TS Extensions - Phase 3: adapters + proxies
Add the C# translation layer that presents JSON-RPC data from Node.js
extensions as native CmdPal WinRT interfaces. Additive library code under
Microsoft.CmdPal.UI.ViewModels/Models plus MSTest coverage driven by an
in-memory fake extension. No node spawning, discovery, hot-reload, or
DI/UI wiring (those are Phase 4).

Adapters/proxies:
- JSModelMapper, JSCommandResultParser, JSCommandFactory (static mappers)
- JSInvokableCommandAdapter, JSCommandItemAdapter, JSListItemAdapter,
  JSFallbackCommandItemAdapter, JSFiltersAdapter
- JSListPageProxy, JSDynamicListPageProxy, JSContentPageProxy,
  JSFormContentProxy
- JSCommandProviderProxy, JSCommandSettingsProxy

Reuses the Phase 2 JsonRpcConnection for outbound requests and notifications.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f9b90e37-dcfc-4ea7-8a79-87eb2af072b6
2026-08-28 13:06:18 -05:00