Repository navigation
Plugin providers: TLS profiles, installation-owned profiles, retained page fix and market logos - #617
Merged
AAswordman merged 19 commits intoDec 3, 2026
Conversation
…hooks The usage and check-in hooks already received `auth` (method, account label, plugin data) beside the token, but listModels, sendMessage, testConnection and calculateInputTokens only got the access token, so a plugin whose request signing needs the account it signed in as (Qoder's machine id and device token, ZCode's device id and plan) could not resolve it. Resolve the auth context through the runtime support trait for every provider hook and declare it on the base event payload. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
Icon sets ship monochrome glyphs as `currentColor` so the host picks the colour; flutter_svg paints them black, which disappears on a dark theme (the Qoder provider logo is one). Substitute the icon colour into the SVG text before rendering and leave logos that name their colours untouched. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
The provider type picker and the provider type field of the account form rendered `ProviderBrandLogo` straight from the catalog asset, which plugin providers do not have, so they fell back to their initial while every other surface showed the package logo. Route entries that come from a plugin package through `ProviderLogo` with the package name and clients. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
`prepareHttpRequest` always appended the body type's Content-Type, so a request that named its own (a plugin serialising and signing a JSON body sent as `text/plain`) went out with two headers and Qoder's token exchange answered 415 Unsupported Media Type. The body type now only names a default when the caller stated none. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
`http_request` takes a `tls_profile` object naming the cipher suites, key exchange groups and signature algorithms (IANA ids), the ALPN list and the OCSP-stapling, SCT and GREASE switches of the TLS client to present instead of the host's own; `HttpRequestData` carries it to the host. The OkHttp bridge gains `RequestBuilder.tlsProfile(profile)`. Only a package whose manifest declares `network.tls_profiles` may name one, never the model: the JS execution host admits the parameter against the package's declaration. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
`operit-host-native-http` gains the `tls-profiles` feature: a request that names a TLS profile is sent over BoringSSL configured as the profile says (cipher list, groups, signature algorithms, ALPN, OCSP stapling, SCT, GREASE) with the system's trust store, HTTP/1.1 written with the caller's header names and order, chunked and fixed bodies streamed to the same callbacks the host's own client feeds. A profile naming BoringSSL's default suites gets the default list, whose order is Bun's; an explicit list is ordered differently. Desktop hosts, the Windows/Linux/macOS CLI and the Flutter desktop bridge enable the feature; Android, iOS and OpenHarmony builds answer that the host does not present profiles. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
BoringSSL's build script runs bindgen, which loads libclang at build time; Windows has none. `tools/build_scripts/prepare_libclang.py` keeps one under .ci-tools (the PyPI wheel), and the Flutter bridge's CMake build passes `OPERIT_LIBCLANG_DIR` to cargo as `LIBCLANG_PATH`, the variable the Android build already reads. BUILDING.md lists the pieces the `tls-profiles` feature needs on each desktop platform. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
…ild.py BoringSSL's build runs bindgen and NASM; Windows ships neither, so the desktop build failed inside boring-sys with bindgen's "Unable to find libclang". `tools/build_scripts/prepare_tls_toolchain.py` now installs both under .ci-tools (NASM 2.16.03 pinned by SHA-256, the PyPI libclang wheel), and `cargo_build.py`, which every Windows cargo build goes through, puts `.ci-tools/nasm` on PATH and that libclang into `LIBCLANG_PATH` for the manifests that build the `tls-profiles` feature, stopping with that instruction when either is missing. The Flutter bridge CMake no longer forwards a variable of its own. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
…n tools over the Bun profile Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
The Android bridge now builds operit-host-native-http with tls-profiles, so a package that declares network.tls_profiles keeps its TLS client there. boring-sys takes the toolchain Gradle already passes (ANDROID_NDK_HOME for the NDK's CMake toolchain, LIBCLANG_PATH for bindgen); the client trusts Android's own CA store, the PEM files under /system/etc/security/cacerts and the Conscrypt module, since rustls-native-certs reads none there. iOS and OpenHarmony stay without it. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
cmake-rs builds MNN and BoringSSL through the NDK's android.toolchain.cmake, which defaults to API 21 when ANDROID_PLATFORM is unset while the CC/CXX wrappers above are the API-<minSdk> ones; BoringSSL's second configure, for the crypto target, then failed its C++ feature checks against the mismatch. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
… target The NDK's CMake toolchain rewrites whatever compiler it is given to its generic clang with its own --target, and boring-sys (BoringSSL) configures once per library: the second configure saw the API-level wrapper again, reset its cache against the rewritten compiler and failed BoringSSL's C++ checks. Cargo now gets the generic clang carrying the wrapper's target flag through CFLAGS_<target>/CXXFLAGS_<target>, so the toolchain has nothing to rewrite; the linker keeps the wrapper. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
A ToolPkg AI provider that bridges to the host's native tool calling used to stream a tool call's parameter chunks straight into the conversation as they arrived. When the model interleaved several calls, the opening tags of one call were emitted before the previous call was closed, and the Core-side parser saw crossed <tool_*> tags and dropped the call or failed the turn. Parameters are now collected per request index and nothing is emitted until the package's hook returns. Core then writes each call as one complete, contiguous block in the model's order. Any parameter that is not a JSON object fails the whole batch with a precise error instead of producing a half-written call. The Core-facing contract (per-index collection, toolCall/toolCallDone/ toolCallsDone, complete `toolCalls` arrays) is documented in docs/model-catalog.md. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
A provider profile created by a ToolPkg provider was stored like a built-in
provider's: in the Space-synced model preferences. Uninstalling the package on
one device left a profile whose dynamic provider no longer existed, and every
other device inherited the same orphan through Space sync. Device-only state
(function bindings, chat model selection, quota and check-in preferences) also
travelled through the shared store.
- Provider profiles now live under the package's installation
(runtime/extensions/{scope}/provider_profiles/<sha256(pkgId)>/<owner>/...), so
a scope move, snapshot, backup or uninstall carries or removes them with the
package. `ExtensionStore::withPackageInstallation` serializes writes per
package and refuses to touch an installation whose journal is unfinished.
- A profile keeps the `profileOwnerId` of the installation that created it, so a
reinstall that reuses the package id cannot adopt stale profiles.
- Profiles written before this change are migrated into the scoped storage only
on the node that authored them (by `originDeviceId`); the shared copies are
retired from the synced snapshot, and `Kernel::export_retained` filters the
stale legacy operations out of the history exported to new devices.
- Device-scoped providers keep their bindings, per-chat model selection and
quota/check-in preferences in the CoreNodeStateStore overlay instead of the
shared preferences; portable providers keep syncing as before. Deleting a
chat clears its local selection.
- The chat composer and model picker render a device-scoped provider from its
stored profile even when the package is not loaded, showing an unbound state
instead of silently switching the user to another provider. Execution still
validates the provider strictly.
- `ExtensionCatalogController.deletePackage` fails loudly when Core reports the
package was not removed.
docs/model-catalog.md documents the lifecycle (ownership, scope moves, uninstall,
Space delivery and the device-only preference split).
Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
RetainedPage applied every configuration change, including the parent's, inside its own layout callback. When a parent rebuild moved a keyed subtree that held an OverlayPortal (MenuAnchor, Autocomplete, Tooltip), the portal re-attached its overlay children during layout and Flutter failed with "A _RenderLayoutBuilder was mutated in _RenderRetainedPage.performLayout", then silently dropped the moved subtree and its state. Parent-provided configurations are now applied synchronously in mount/update like any other element, so such moves happen in the build phase. Updates requested by the page itself keep the layout-callback timing, so microtasks scheduled during those builds still run only after the frame has laid out. A per-BuildOwner scheduler hook keeps normal frame scheduling alive when only a dormant scope is dirty. Tests cover keyed MenuAnchor subtrees moving between parent revisions in the build phase, the microtask timing of page-internal builds, and same-frame ticker-driven updates. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
The market only ever saw the plugin package: `manifest.logo` lives inside the .toolpkg, so logos showed up only after a package was installed locally. ArtifactPublishScreen now uploads the package's LOGO next to the plugin package in the same GitHub Release on both publish paths, as `<asset-without-extension>.logo.<ext>` with the MIME type Core normalizes (svg/png/jpg/webp). An existing asset with the same name is replaced first. A package without a logo is reported before publishing, with the manifest snippet to add one. Retrying a failed market registration does not upload again. The package builder docs describe the `logo` manifest field and its resource entry; docs/market-logo-assets.md records the investigation, the client contract and the server-side work needed to expose the asset URL. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
ToolPkg providers expose slot ids such as `qmodel_38max` while their model list carries the name users read (`Qwen3.8-Max`). The UI formatted the id, so every picker showed the slot. `ModelListedSpec.name` and `ProviderModelSummary.listedName` now carry that name from the provider's list; the composer label, the model selector popup, the available-model picker, the settings panel and the function mapping rows show it in place of the formatted id and match on it when searching. Model ids stay the storage and sync keys. Signed-off-by: luojiaping <luojiaping@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Host-side changes for the ToolPkg provider work, split into three areas.
1. TLS profiles for packages (host + build)
feat(http): a ToolPkg HTTP call can present a TLS profile; the caller'sContent-Typeis no longer overridden by the body type's default.feat(host): profiles are presented through a BoringSSL client (operit-host-native-http, featuretls-profiles), also on Android (generic NDK clang +--target, minSdk platform, perl for the BoringSSL assembly in the images).build(windows):cargo_build.pyprovisions NASM and libclang for BoringSSL/bindgen; BUILDING.md lists the toolchain pieces.feat(provider): signed-in account facts are handed to ToolPkg provider hooks; package logos show in the create-provider picker andcurrentColorSVGs take the theme's icon colour.2. Provider lifecycle for ToolPkg providers
fix(provider): host-bridged native tool calls are collected per index and emitted as complete, contiguous blocks after the package hook returns; non-object parameters fail the whole batch. Contract documented indocs/model-catalog.md.feat(models): provider profiles are owned by the package installation (runtime/extensions/{scope}/provider_profiles/...,profileOwnerIdgeneration), so scope moves / snapshots / uninstalls carry or remove them. Legacy shared profiles migrate only on the authoring node (originDeviceId), the shared copies are retired and filtered from exported history (Kernel::export_retained). Device-scoped providers keep bindings, per-chat selection and quota/check-in preferences in theCoreNodeStateStoreoverlay; the chat composer renders unbound states instead of switching providers;deletePackagefailures surface in the Flutter catalog.3. Flutter fixes and market logos
fix(app):RetainedPageapplies parent-provided configurations in the build phase instead of its layout callback (fixesA _RenderLayoutBuilder was mutated in _RenderRetainedPage.performLayoutand the state loss that followed); page-internal updates keep the layout-callback timing.feat(market):ArtifactPublishScreenuploads the package LOGO beside the plugin package in the same Release (<asset>.logo.<ext>, MIME normalized by Core) on both publish paths; package-builder docs describe thelogomanifest field;docs/market-logo-assets.mdrecords the contract and the server-side follow-up.4. Listed model names
feat(models):ModelListedSpec.name/ProviderModelSummary.listedNamecarry the name the provider's own list gave a model (ToolPkg slots such asqmodel_38maxread asQwen3.8-Max); the composer label, model selector popup, available-model picker, settings panel and function mapping rows show and search it. Model ids remain the storage/sync keys. (Work in progress from the same tree; included on request.)A
chore(deps)commit reconciles the four lockfiles withmain.Platforms / boundaries
operit-host-contract,operit-httphost (common),operit-store,operit-provider-services,operit-runtime-application,operit-tool-services.RetainedPage.host-contract) and the sqlite host parameter onExtensionStore::{moveScope, delete, deleteFailedPackageInstallations}(adapted tomain's signatures). Dart proxy regenerated from unchanged Core commands.Verification
mainapplied cleanly; the five textual conflicts in Task 2 files were resolved towardmain's storage-injected managers (ModelConfigManager::withStorage/FunctionalConfigManager::withStorage) and the sqlite-hostExtensionStoresignatures; test call sites were adapted.cargo metadata --lockedpasses forapps/cli, the Flutter bridge,hosts/{apple,linux,windows}andoperit-host-native-http.cargo testfor the touched crates andflutter test/flutter analyze(CI should cover; the author will also run them). TheRetainedPagetests and provider-lifecycle tests are included in this PR.Not included
qoder,zcode,workbuddy,zen-free, …) are published separately..cnb/*) and unrelated local staging stay on the fork.