Commit 3a1905b
Add shared Windows.UI.Shell.Tasks (Forerunner) integration to SDK crate
Factor the common Rust integration with the experimental
Windows.UI.Shell.Tasks ("Forerunner" / taskbar presence) API, previously
duplicated between the Copilot desktop app (github/github-app) and the CLI
(github/copilot-agent-runtime), into the github-copilot-sdk crate so both
products can consume one implementation.
New `shell_tasks` module under `rust/src/shell_tasks/`, behind the
off-by-default `shell-tasks` Cargo feature:
- `contract`: verbatim copy of the CLI `taskbar-contract` crate. Pure-std,
FFI-free contract for the hover-card round-trip (named-pipe name, focus
sidecar file name, sidecar payload format) with its unit tests.
- `bindings`: verbatim copy of the CLI vendored WinRT projection of
AppTaskContract, re-exported as `Windows`. Gated on `#[cfg(windows)]`.
The `windows`/`windows-core` deps are optional and Windows-only (declared
under [target.'cfg(windows)'.dependencies]), activated only by the
`shell-tasks` feature, mirroring how `bundled-cli` gates its optional `zip`
dep. Non-Windows and feature-off builds pull neither crate.
Verified on Windows: default `cargo check` plus `cargo
build/test/clippy/doc --features shell-tasks` all green (contract unit
tests pass).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 67c6593a-bb90-4106-a143-49c19fa32a0d
Add shared AppTaskContent builder to shell_tasks module
Extract the WinRT AppTaskContent call sequence that the Copilot desktop
app and CLI implement identically into a neutral, data-driven builder.
The new content module exposes a cross-platform ContentSpec/ContentBody
data model plus #[cfg(windows)] build_content/make_uri/make_result_asset
helpers that faithfully reproduce both products' WinRT sequences
(CreateSequenceOfSteps, CreatePreviewThumbnail, CreateTextSummaryResult,
CreateGeneratedAssetsResult, SetQuestion, AddButton, SetTextInput,
AppTaskResultAsset::CreateInstance). Product-specific preparation
(template dispatch, asset caps, file:// resolution, deep-link building)
stays in each adapter, which hands the builder an already-resolved spec.
Feature-gated behind shell-tasks; 4 new unit tests (15 total).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 67c6593a-bb90-4106-a143-49c19fa32a0d
Add shared sparse-package identity registrar to shell_tasks
Factor the WinRT sparse (external-location) package registration routine
out of the CLI's napi bridge into a napi-free shell_tasks::sparse module
so both the CLI and the desktop app can share one implementation.
The module exposes plain synchronous, #[cfg(windows)] functions
(register_sparse_package, deregister_sparse_package,
current_package_family_name) plus the process-lifetime MTA keepalive
(ensure_process_mta) that guards windows-rs's cached activation
factories against the 0xC0000005 fault. Neutral result types
(RegisterOutcome, SparseError) compile on every platform. Each product
wraps these in its own async surface (CLI napi AsyncTask; app
spawn_blocking/Tauri) and keeps its own AppxManifest and registration
trigger.
Adds ApplicationModel/Management_Deployment/Win32_System_Com to the
Windows-only optional windows dep. Feature-gated behind shell-tasks;
2 new cross-platform tests (19 total).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 67c6593a-bb90-4106-a143-49c19fa32a0d
Extract shell_tasks into standalone github-copilot-shell-tasks crate
Move the shared Windows.UI.Shell.Tasks integration out of the
github-copilot-sdk client crate into a standalone, build.rs-free
workspace member at rust/crates/github-copilot-shell-tasks so it can be
consumed by the CLI's napi addon (and the desktop app's Tauri backend)
without dragging in the full SDK client dependency tree or its
network-touching build.rs.
- New crate github-copilot-shell-tasks (lib github_copilot_shell_tasks)
owns contract/content/sparse/bindings; only deps are the Windows-only
windows/windows-core crates, gated under cfg(windows).
- rust/Cargo.toml becomes the workspace root; the shell-tasks feature now
pulls the optional path dep, and the client re-exports it as
github_copilot_sdk::shell_tasks. windows/windows-core deps moved to the
new crate.
Validated on Windows: standalone crate builds with no download and no
warnings; 17 tests pass; clippy/doc clean; client builds/docs with
--features shell-tasks; default (feature-off) check unaffected.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 67c6593a-bb90-4106-a143-49c19fa32a0d
Re-export windows/windows-core from shell-tasks crate for island consumers
Add `pub use ::windows;` and `pub use ::windows_core;` (both `#[cfg(windows)]`)
to the `github-copilot-shell-tasks` crate root so a consumer that adopts the
crate as an isolated WinRT island (the desktop app's Tauri backend, pinned to
an older `windows` via Tauri/wry) can funnel all of its Windows.UI.Shell.Tasks
call-sites and the supporting WinRT types (Foundation::Uri,
ApplicationModel::Package, Win32::System::Com, HSTRING) through the exact
`windows` 0.62 version the projection was generated against, without declaring
its own conflicting `windows` dependency.
Crate build, clippy, and 17 unit tests pass; the client crate still builds with
the `shell-tasks` feature.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 67c6593a-bb90-4106-a143-49c19fa32a0d1 parent f324f72 commit 3a1905b
9 files changed
Lines changed: 1904 additions & 0 deletions
File tree
- rust
- crates/github-copilot-shell-tasks
- src
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
36 | 49 | | |
37 | 50 | | |
38 | 51 | | |
| |||
59 | 72 | | |
60 | 73 | | |
61 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
62 | 79 | | |
63 | 80 | | |
64 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments