diff --git a/devlog/_plan/260912_cline_client/000_plan.md b/devlog/_plan/260912_cline_client/000_plan.md new file mode 100644 index 0000000000..db1e08735d --- /dev/null +++ b/devlog/_plan/260912_cline_client/000_plan.md @@ -0,0 +1,24 @@ +# Cline integration roadmap + +Cline users need a reversible connection and routed model list. This unit connects the current Cline CLI storage contract through the existing integration operations and dashboard. Cline stores connection settings and the model catalog separately, so one operation must snapshot and restore both files. + +Loop: satisfy-spec, HOTL; trigger: #4214 and delegated lane=cline. Scope: config exporters, integration writer/reader/journal projection, existing CLI/catalog/dashboard registries, translated copy, source fixtures. Non-goals: legacy extension storage migration, Cline process control, user configuration changes during development, merges/releases, new dependencies. All local product suites, builds/typecheck/install are NOT RUN by instruction; regression execution belongs to final-tip GitHub hosted CI. Text checks and independent source audits are allowed. No user token/time/agent caps; existing tool/account scope only. + +Outcome: DONE requires source-backed contracts, actual implementation, separate PABCD cycles, independent reviews, final cumulative head CI, PR and durable handoff. Unavailable tools or genuine external blockers are recorded without claiming completion. Main implements; inherited read-only subagents review. Native architect role selection is unavailable; the explicit parent instruction authorizes supported spawn for actual design and reflection reviews. No role installation or settings changes. + +Sources: [001_contract.md](001_contract.md). Repository owners: src/clients/config-export.ts, src/integrations/{registry,state,writer,journal,store,config-io}. Existing config builder, exact fragment ownership, atomic file writes and journal are reused. No-op/manual-only configuration cannot meet sync/undo; a separate standalone configuration engine is unnecessary. + +| Cycle | Deliverable | Dependency | Design | +| --- | --- | --- | --- | +| roadmap | Audited docs only | none | This roadmap and all decade docs | +| contract | Pure Cline documents, paths, paired journal adapter and regression fixtures | roadmap | 010_contract.md | +| surfaces | Catalog refresh, CLI help and existing dashboard exposure | contract | 020_surfaces.md | +| verification | Independent audit, fixes, PR publication and final-tip hosted CI | surfaces | 030_verification.md | + +PR decision: one cohesive Cline PR unless the audited paired-file foundation is independently useful and large enough to split. Ordinary manual chain only if split; no native stacks. Intermediate commits may be pushed without waiting on CI. Parent owns merge. + +Verification: git diff --check (text only), source review, final-head Cross-platform CI (tests/typecheck/GUI build/lint). Source tests use temporary home/store; no real Cline data. Fixture cases: missing/partial install; malformed, non-regular or foreign edited files; wrong version; foreign provider preserved; owned model removal/port change; second-file failure; bookkeeping failure; interrupted transaction and drift; exact two-file restore including absence. A Cline restart is required after externally written catalogs. Live client process behavior is source-backed, not a claimed local canary. + +Public source docs update structure/clients/integrations.md plus CLI/UI owning docs for changed surfaces; public user workflow resides in docs-site. Unreleased security analysis stays under .tmp/cline. Durable handoff: .tmp/cline/handoff.md. + +Design reflection: ALIGNED D09/D10. R02 accepted: no unattended Cline refresh; explicit sync only with stopped-client precondition. R03 accepted: journal presence never blesses a mixed pair or inconsistent ownership. Verify both intended bytes and final record before clearing a committed marker. diff --git a/devlog/_plan/260912_cline_client/001_contract.md b/devlog/_plan/260912_cline_client/001_contract.md new file mode 100644 index 0000000000..bbd9cd3c0d --- /dev/null +++ b/devlog/_plan/260912_cline_client/001_contract.md @@ -0,0 +1,14 @@ +# Cline source contract + +Upstream revision: cline/cline cfe9cadab99617d5013bf89f07b079d105057791, read 2026-09-12. Scope is the current CLI/shared SDK provider store. Legacy VS Code globalState/secrets storage is not the same contract and is not detected as compatible. + +- sdk/packages/shared/src/storage/paths.ts:152-185,424-430 resolves CLINE_PROVIDER_SETTINGS_PATH; otherwise CLINE_DATA_DIR/settings/providers.json; otherwise CLINE_DIR/data/settings/providers.json; otherwise ~/.cline/data/settings/providers.json. Relative overrides are rejected by OpenCodex because its cwd is not Cline's cwd. +- sdk/packages/core/src/types/provider-settings.ts:33-68 defines version=1, optional lastUsedProvider, modes={}, providers[id]={settings,updatedAt,tokenSource}. settings.provider is the provider ID; protocol openai-responses, client openai, baseUrl, apiKey and model are accepted. +- sdk/packages/core/src/services/llms/provider-settings.ts:155-199,224-315 maps protocol openai-responses to the OpenAI handler while retaining the custom provider ID and namespaced model. +- sdk/packages/core/src/services/providers/local-provider-registry.ts:48-121 defines sibling models.json: version=1, providers[id]={provider:{name,baseUrl,protocol,client,defaultModelId},models:{id:{name,contextWindow,modalities,supportsVision}}}. +- The same file:689-716 caches model-file loading per process. Restart Cline after external updates; do not claim a running picker is live-synchronized. + +CLINE-D09 accepted: settings.modelCatalog.url is not an OpenAI /v1/models endpoint. Its loader expects models.dev data, and picker paths do not forward that setting. A single providers.json does not meet full catalog acceptance. +CLINE-D10 accepted: write providers.json plus sibling models.json as one recoverable journal operation. Each rename is atomic; a filesystem has no atomic rename across both files. Stop Cline before apply/refresh/restore and restart after. Interrupted writes require durable recovery and foreign edits must refuse recovery. + +All paths above are pinned under https://github.com/cline/cline/blob/cfe9cadab99617d5013bf89f07b079d105057791/ . No upstream implementation is copied; schema-shaped fixtures use synthetic data. No original carry PR or author credit applies. #3833 is a Command Code reference, not a dependency. diff --git a/devlog/_plan/260912_cline_client/009_roadmap_result.md b/devlog/_plan/260912_cline_client/009_roadmap_result.md new file mode 100644 index 0000000000..d5fe20dcb0 --- /dev/null +++ b/devlog/_plan/260912_cline_client/009_roadmap_result.md @@ -0,0 +1,5 @@ +# Roadmap cycle result + +Docs-only roadmap locked after inherited source/design review and independent A audit. Accepted D09/D10, excluded unattended refresh, strengthened journaled recovery recognition, and added target collision refusal. Existing CLI syntax is --client cline / restore --op; no positional alias is invented. + +Source audit confirms two files are needed. No product files changed in this cycle. git diff --check is the permitted document whitespace check; local product tests are NOT RUN. Next cycle executes 010_contract.md; downstream implementation and hosted proof remain open. The one-file modelCatalog URL hypothesis did not survive upstream inspection. diff --git a/devlog/_plan/260912_cline_client/010_contract.md b/devlog/_plan/260912_cline_client/010_contract.md new file mode 100644 index 0000000000..d822cd1881 --- /dev/null +++ b/devlog/_plan/260912_cline_client/010_contract.md @@ -0,0 +1,26 @@ +# Contract and paired-file operations + +Depends on roadmap. C4 care for reversible config mutation; no local execution. Use existing journal and ownership, not a second ownership database. + +NEW src/clients/config-export/cline.ts: typed pure buildClineClientConfig, summarizeCline and buildClineContribution. Build {settings:{version:1,modes:{},providers:{opencodex:{settings:{provider:'opencodex',protocol:'openai-responses',client:'openai',apiKey:LOOPBACK_API_KEY_PLACEHOLDER,baseUrl},updatedAt:stable schema timestamp,tokenSource:'manual'}}},catalog:{version:1,providers:{opencodex:{provider:{name:'OpenCodex',baseUrl,protocol:'openai-responses',client:'openai'},models}}}}. Namespaced routed IDs are model-map keys. Preserve authoritative context and modality metadata; omit invented costs/output limits. Do not manage lastUsedProvider: users select OpenCodex explicitly (cline --provider opencodex --model provider/model), preserving their default. Empty catalog exports no invented default/model. Managed paths are settings.providers.opencodex and catalog.providers.opencodex; schema envelope defaults are initialized only when absent and retained on disable. + +MODIFY src/clients/config-export/contracts.ts: append cline to ExportClientId. Creation: EXPORT_CLIENTS; serialization: builder/JSON download; deserialization: isExportClientId and journal isIntegrationClientId; consumers: integration registries, CLI export, management route and browser lists in 020. +MODIFY src/clients/config-export.ts: import/register cline builder and append EXPORT_CLIENTS.cline; export path helpers using existing absoluteClientPath. destination is providers.json; filename cline-config-bundle.json; format json; hint explains two document members and restart, no standalone direct-file claim; loopbackOnly true. +MODIFY src/integrations/registry.ts: append cline paths, detect settings directory, sibling lock .lock. Resolve explicit provider-file override first and derive catalog from dirname; no user discovery scanning. + +NEW src/integrations/cline-document.ts: private codec between two raw file strings (snapshot bundle) and logical settings/catalog objects (managed fragments). Reads preserve exact raw bytes and file absence. Parsing invokes existing safe strict JSON parser for each member; reject invalid/non-object schema and unsupported version. Rendering initializes missing version=1/modes={} and serializes both native files, then canonicalizes the raw-string snapshot envelope. Never serialize journal-only metadata into Cline files. +NEW src/integrations/cline-io.ts: adapt the existing IntegrationIO only for cline and the resolved primary path. Secondary path is dirname(primary)/models.json; no caller-provided arbitrary secondary path. Reject primary path named models.json (case-insensitive), and refuse symlink/non-regular members so two logical members cannot alias one target. Read/stat inspect both members; write uses existing atomic writer for each, compensates on any failure. Snapshot remains the existing journal's one bundle snapshot. Persist a private pending transaction before first rename, including original/result bundle and prior ownership; clear only after journal append. Recover an interrupted operation only on an explicit mutation, only if every current file is exactly original or intended result; if its opId is already journaled, recognize completion only when BOTH intended bytes and final ownership match; otherwise retain unsafe pending state. Foreign edits or invalid pending data refuse and retain recovery evidence. Read-only status never performs recovery. Report partial compensation failure truthfully. +MODIFY src/integrations/config-io.ts: optional begin/finish transaction hooks on IntegrationIO; existing clients unaffected. +MODIFY src/integrations/writer.ts: resolve Cline adapter after path resolution, invoke begin hook before commit; use client codec at parse/render boundaries; finish after journal or successful compensation; preserve existing state/refusal logic. Restore reads the same bundle and journal. Coordinated mutation locks encompass recovery and commit. +MODIFY src/integrations/state.ts: same adapter/codec for classification; pending state unsafe; no mutation on read. Journal API's matchesOperationResult projection reads through the adapter so restore eligibility describes both files. +MODIFY structure/clients/integrations.md: state two-file ownership and transaction/restart/rollback contract. + +NEW tests/clients/cline-client.test.ts: source-shaped generation, env precedence, no secrets, model removal/metadata, initialized install and missing install. NEW tests/clients/cline-writer.test.ts: temporary home and store with real writer, both-file exact restore, absent member restore, invalid JSON/schema, occupied provider refusal/explicit overwrite, foreign edits, second-file and journal failures, crash recovery and foreign-edit refusal. Register both paths in scripts/test-layout/layout.json and tests/fixtures/test-layout-expected.json. Extend existing exact client-list assertions without deleting checks. + +Activation evidence is final-tip hosted tests. Locally only diff/text audit; code unverified until hosted result. Pending marker is an early recovery mechanism, not cross-process exclusion against Cline: Cline does not share OpenCodex's lock. User-visible contract requires it stopped; filesystem rename cannot prevent a non-cooperating writer. No claim of simultaneous two-file visibility. + +A synthesis: accepted target collision guard and regression; post-journal marker cleanup is best-effort and must not cause compensation. Normal Cline settings saves update updatedAt/model, so declare only settings.providers.opencodex.updatedAt and settings.providers.opencodex.settings.model as refreshable; preserve selected model while still in desired catalog, remove it if no longer routed. All connection/auth metadata remains protected. + +Contract P resumes previous D: "Docs-only roadmap complete; next contract cycle" (009). No product source changed since source inspection. Implementation uses existing JSON format plus client-specific parse/render dispatch, avoiding a new public ConfigFormat enum. Export is a human-readable {settings,catalog} document bundle; internal journal envelope stores each raw file string for exact restore. This distinction is explicitly documented and tested. Path helper implementation additionally rejects case-insensitive models.json collision. No product command is executed locally. + +Implementation delta: cline builder/paths, private raw pair codec, paired IO and pending journal hooks are implemented; normal model/timestamp writes use the existing narrow refreshable-path mechanism. Existing lifecycle tests now read Cline's logical pair through the production adapter instead of treating its primary file as the whole document. Source checks only so far; hosted suite remains in verification cycle. New tests cover file absence, unsafe version/nonregular member, explicit conflict overwrite, model retirement, foreign edits, write/bookkeeping failure and pending recovery. diff --git a/devlog/_plan/260912_cline_client/019_contract_result.md b/devlog/_plan/260912_cline_client/019_contract_result.md new file mode 100644 index 0000000000..77d93bddca --- /dev/null +++ b/devlog/_plan/260912_cline_client/019_contract_result.md @@ -0,0 +1,5 @@ +# Contract implementation checkpoint + +The Cline builder, path resolver, raw-byte pair projection, pending recovery and existing writer/journal integration are implemented. Regression source covers normal lifecycle, native schema refusal, two-file compensation and recoverable interruption. Independent implementation review is in flight and is a required input to the final verification cycle. + +Local product tests, typecheck, builds and installation: NOT RUN by explicit user instruction. This checkpoint asserts code/source completion only; runtime correctness remains unverified until final cumulative hosted CI. git diff --check is the permitted text check. Next cycle wires existing CLI/dashboard surfaces and explicit catalog sync. No PR or merge yet. diff --git a/devlog/_plan/260912_cline_client/020_surfaces.md b/devlog/_plan/260912_cline_client/020_surfaces.md new file mode 100644 index 0000000000..6114503acf --- /dev/null +++ b/devlog/_plan/260912_cline_client/020_surfaces.md @@ -0,0 +1,14 @@ +# Existing CLI, catalog and dashboard surfaces + +Depends on contract; re-read source after 010 before B. Extend existing entry maps, no new endpoint/component architecture. + +Keep Cline out of unattended catalog-refresh default ids because the client must be stopped. MODIFY explicit sync lists src/cli/dispatch.ts and src/server/management/config-routes.ts: append cline. Keep lazy owned-only refresh and foreign-edit refusal; regression in tests/clients/cline-writer.test.ts verifies unowned untouched, owned refresh changes both files, model removal and endpoint changes. +MODIFY src/cli/registry.ts export usage/summary: append cline/Cline. Existing integration verbs remain --client cline and restore --op ID; documentation must not invent positional arguments. Update focused CLI export/list expectations and existing sync source fixtures. + +MODIFY gui/src/pages/integrations/integration-api.ts client tuple, integration-tabs.ts TABS/FILE_CLIENTS, gui/src/app-routing.ts hash list, overview-clients.ts label map, FileIntegrationPage.tsx semantics/label maps, gui/src/components/apikeys-workspace/client-config-clients.ts CLIENTS/labels/marks, gui/src/components/integration-marks.ts exhaustive map: append cline. Reuse existing page and consequence/rollback dialogs. Reuse the existing gui/public/provider-icons/cline-color.svg already used by provider-icons.ts; no new brand asset. +MODIFY all gui/src/i18n locale modules: append integrations.tab.cline, integrations.semantics.cline, api.clientConfig.clientCline. Copy states: current Cline CLI provider store; both files; stop before mutations, restart after; Undo restores both originals; default provider remains user-controlled. Parent handoff records these exact shared-file touches. +MODIFY docs-site/src/content/docs/guides/integrations.md: documented installation contract, env precedence, --client verbs, conflict opt-in, --op restore/drift, two-file export format and running-client limitation. Update structure/runtime.md and structure GUI/CLI ownership docs where applicable with factual links to canonical integration contract. + +Verification: existing GUI client-list/route/i18n assertions extended for cline. No local GUI tests/build. Final hosted GUI build/lint/tests; obtain hosted screenshot artifact where available and inspect it. If unavailable report missing visual evidence rather than fabricate screenshot. No real user server configuration is used for capture. + +Surfaces P resumes 019: "next cycle wires existing CLI/dashboard surfaces and explicit catalog sync." Source lists still end in omo; append Cline only. Existing cline-color.svg is reused. Public guide path verified as guides/integrations.md. Independent core audit corrections remain mandatory in the final verification cycle; these list/copy changes do not depend on its implementation details. diff --git a/devlog/_plan/260912_cline_client/029_surfaces_result.md b/devlog/_plan/260912_cline_client/029_surfaces_result.md new file mode 100644 index 0000000000..eecf696e87 --- /dev/null +++ b/devlog/_plan/260912_cline_client/029_surfaces_result.md @@ -0,0 +1,5 @@ +# Surface wiring checkpoint + +Cline CLI appears in existing integration, export, route and mark registries. Nine dashboard locales explain the paired-file stop/restart and Undo contract. English and existing translated integration guides identify the current CLI schema. Explicit sync includes previously owned Cline files; unattended catalog refresh excludes Cline. + +The existing committed Cline color mark is reused. No layout or new UI component was introduced. Local GUI tests/build/typecheck and product suites are NOT RUN. git diff --check is text-only evidence. Runtime and rendered verification remain on the final cumulative hosted tip; core recovery review corrections remain mandatory in the next cycle. Next direction: inspect the two concrete recovery findings, repair with regression source, then publish and track CI. diff --git a/devlog/_plan/260912_cline_client/030_verification.md b/devlog/_plan/260912_cline_client/030_verification.md new file mode 100644 index 0000000000..30abc74225 --- /dev/null +++ b/devlog/_plan/260912_cline_client/030_verification.md @@ -0,0 +1,13 @@ +# Independent audit and final hosted tip + +Depends on surfaces. Audit all acceptance rows against final source and tests; use a fresh inherited read-only subagent (no local tests/build/install, no user data or writes). Fold correct findings into code and docs in this cycle; add further cycles if a new implementation unit is needed. Security analysis stays in .tmp/cline. + +MODIFY only files implicated by concrete findings. git diff --check is whitespace evidence, never test evidence. Commit scoped source and docs; git push --no-verify origin HEAD. Create ordinary PR with base dev (or actual parent branch if audited split), filling Summary/Verification/Checklist and linking #4214 without claiming unresolved acceptance. No original PR exists; no carried author identity invented. + +Read current head/base/reviews and CI workflow event/ref. Track final cumulative SHA through hosted Cross-platform CI; record run URL/ID, actual head and check results. Do not cancel runs or modify workflow/protection. Fix attributable final failures and repeat at the resulting head. No suite can be hidden in a receipt helper; receipt can capture permitted source checks or read-only GitHub CI verification, labeled accurately. + +MODIFY .tmp/cline/handoff.md immediately after each deliverable: worktree/branch, PABCD cycle/phase, PR URL/full head SHA/order, issue disposition, remaining acceptance, attribution, hosted run evidence, NOT RUN local checks and unresolved reviewer findings. Final completion requires all recorded criteria; CI pending is not success. Parent performs all merges and decides issue closure. + +Verification P resumes 029's next direction. Concrete private audit repair plan is .tmp/cline/repair-plan.md; final source proof must include strict recovery metadata and history reads. Two accepted independent findings are being corrected before publication. This cycle retains all original CI, source, rollback and handoff criteria. + +Source review also found the shared export dialog described every download as a single native file. The Cline branch now uses localized two-document merge instructions and download announcement, and suppresses the irrelevant missing-key hint. Other clients retain their existing copy. A rendered component regression in client-config-panel.test.tsx covers this conditional branch on hosted CI. This is a correctness fix to the existing export surface, not a new export mechanism. diff --git a/devlog/_plan/260912_cline_client/039_gui_evidence.md b/devlog/_plan/260912_cline_client/039_gui_evidence.md new file mode 100644 index 0000000000..a31987f7aa --- /dev/null +++ b/devlog/_plan/260912_cline_client/039_gui_evidence.md @@ -0,0 +1,25 @@ +# Cline component render evidence + +Source commit: 75a8ec8f78718f25343344506e8a5536ca0245a4. GUI tree: bd02a7729603ac669acf47988b065bd8d04dd617. + +The actual FileIntegrationPage and ClientConfigDialog components were rendered in Chrome at +1280 × 773 CSS pixels, DPR 2, with the repository stylesheet, LanguageProvider and committed +Cline mark. The surrounding header labels the view synthetic. Fetch was replaced with fixed +fictional status/history; no real Cline configuration or running OpenCodex API was accessed. + +The source-only preview entry was bundled with Bun in 20 ms using existing React 19.2.8, +without install, typecheck or product build scripts. This is manual component render evidence, +not a test-suite pass, live client canary, or full dashboard build. Local suites remain NOT RUN. + +Observed: Cline label/mark, applied status, localized two-file stop/restart explanation, primary +path and Undo history rendered without clipping. Export dialog shows the settings/catalog bundle. + +![Cline integration with synthetic state](evidence/cline-integration.png) + +The export dialog was scrolled to its instructions. Observed both destination file names, the +journaled integration recommendation and stop/restart explanation; the single-file merge hint +and missing-admission-key hint are absent for Cline. + +![Cline two-file export instructions](evidence/cline-export.png) + +Export capture refreshed after removing the irrelevant Set-the-key heading. GUI tree: a070b75cabe1974e59d407c595709d1ffb3c4a58. Same synthetic harness; entry bundling took 19 ms. No local test execution. diff --git a/devlog/_plan/260912_cline_client/evidence/cline-export.png b/devlog/_plan/260912_cline_client/evidence/cline-export.png new file mode 100644 index 0000000000..24ab32d0e9 Binary files /dev/null and b/devlog/_plan/260912_cline_client/evidence/cline-export.png differ diff --git a/devlog/_plan/260912_cline_client/evidence/cline-integration.png b/devlog/_plan/260912_cline_client/evidence/cline-integration.png new file mode 100644 index 0000000000..eba8e8252e Binary files /dev/null and b/devlog/_plan/260912_cline_client/evidence/cline-integration.png differ diff --git a/docs-site/src/content/docs/fr/guides/integrations.md b/docs-site/src/content/docs/fr/guides/integrations.md index b803c9f2c5..831a7dbaef 100644 --- a/docs-site/src/content/docs/fr/guides/integrations.md +++ b/docs-site/src/content/docs/fr/guides/integrations.md @@ -4,7 +4,7 @@ description: Connectez opencodex à OpenCode, Pi, OMP, Hermes, OpenClaw, Kimi Co --- L'onglet **Intégrations** écrit le bloc fournisseur d'opencodex dans le fichier de configuration du client, -puis peut le retirer. Quatorze clients fonctionnent ainsi, chacun avec son propre commutateur : +puis peut le retirer. Quinze clients fonctionnent ainsi, chacun avec son propre commutateur : | Client | Fichier de configuration | Format | Prise d'effet de la modification | Identifiant | |---|---|---|---|---| @@ -22,6 +22,7 @@ puis peut le retirer. Quatorze clients fonctionnent ainsi, chacun avec son propr | Aside | `~/.aside/u//models.json` | JSON | après avoir quitté complètement puis rouvert Aside | valeur fictive de bouclage | | Raycast | `~/.config/raycast/ai/providers.yaml` | YAML | immédiatement à l'enregistrement — Raycast surveille le fichier | aucun — bouclage uniquement | | omo | `~/.omo/agent/models.json` | JSON | nouvelles sessions | espace réservé de bouclage | +| Cline CLI | `~/.cline/data/settings/providers.json` + `models.json` | JSON | après arrêt et redémarrage | bouclage uniquement | La prise en charge gérée de DSH exige au minimum **DSH 0.1.0-rc.6**. OpenCodex ne possède que le fragment `llm-pi-ai.providers.opencodex` : **Appliquer** et **Actualiser** remplacent ce fragment, **Désactiver** ne @@ -234,3 +235,15 @@ commande refuse et vous l'indique : remplacer vos modifications plus récentes r Les détails des clients ont été vérifiés par rapport au format de configuration propre à chaque projet ; consultez les notes de recherche dans `devlog/_fin/260802_client_toggle_api/002_client_toggle_matrix.md` pour savoir ce qui a été contrôlé et quand. + +## Cline CLI + +Cline CLI utilise providers.json et models.json. Quittez Cline avant toute modification ou synchronisation, puis redémarrez-le. Annuler restaure les deux originaux. Le fournisseur par défaut reste inchangé. Cette intégration ne migre pas le stockage des anciennes extensions VS Code. + +```bash +ocx integration client enable --client cline +ocx integration client history --client cline +ocx integration client restore --op +``` + +[CLI / rollback / CLINE_PROVIDER_SETTINGS_PATH](/guides/integrations/#cline-cli). diff --git a/docs-site/src/content/docs/guides/integrations.md b/docs-site/src/content/docs/guides/integrations.md index f5d6dfa6a4..60dd516a9e 100644 --- a/docs-site/src/content/docs/guides/integrations.md +++ b/docs-site/src/content/docs/guides/integrations.md @@ -1,10 +1,10 @@ --- title: Integrations -description: Connect opencodex to OpenCode, Pi, OMP, Hermes, OpenClaw, Kimi Code, gjc, DeepSeek Harness, MiniMax Code, ZCode, Prime Agent, Aside, Raycast and omo from the dashboard — one switch per client, with a backup taken before every write. +description: Connect opencodex to OpenCode, Pi, OMP, Hermes, OpenClaw, Kimi Code, gjc, DeepSeek Harness, MiniMax Code, ZCode, Prime Agent, Aside, Raycast, omo and Cline CLI from the dashboard — one switch per client, with a backup taken before every write. --- The **Integrations** tab writes opencodex's provider block into a client's own config -file, and removes it again. Fourteen clients work this way, each with a switch: +file, and removes it again. Fifteen clients work this way, each with a switch: | Client | Config file | Format | When the change takes effect | Credential | |---|---|---|---|---| @@ -22,6 +22,7 @@ file, and removes it again. Fourteen clients work this way, each with a switch: | Aside | `~/.aside/u//models.json` | JSON | after fully quitting and reopening Aside | loopback placeholder | | Raycast | `~/.config/raycast/ai/providers.yaml` | YAML | immediately on save — Raycast watches the file | none — loopback only | | omo | `~/.omo/agent/models.json` | JSON | new sessions | loopback placeholder | +| Cline CLI | `~/.cline/data/settings/providers.json` and sibling `models.json` | JSON pair | after stopping and restarting Cline | loopback placeholder | Generated catalogs include only enabled models from each provider selection. This applies to both downloads and managed integrations, including Pi and Aside. The management model list still shows @@ -344,3 +345,53 @@ the entire change failed. If saving those settings fails, no profile files are c Each profile has separate ownership and history. Existing user edits, unsafe paths and linked catalogs are refused; the existing explicit overwrite and drift-confirmation controls remain available. Fully quit and reopen Aside to load changed model files. + + +## Cline CLI + +This integration targets Cline's current CLI/shared SDK provider store, whose native schema has +`version: 1`. Legacy VS Code extension `globalState`/secret storage is not migrated or detected +as this integration. Run Cline once to initialize its settings directory. + +**Stop Cline before enabling, syncing, disabling or restoring the integration.** OpenCodex writes +`providers.opencodex` into both `providers.json` and sibling `models.json`. The first file holds +the OpenAI Responses connection with a non-secret loopback placeholder; the second holds the +filtered routed model catalog, including available context and image metadata. Existing provider +entries and the default provider selection remain unchanged. + +```bash +ocx integration client list --json +ocx integration client enable --client cline +ocx integration client history --client cline +ocx integration client restore --op +``` + +After enabling, restart Cline and select OpenCodex, or launch with +`cline --provider opencodex --model `. External catalog changes are read when +Cline restarts. Cline is excluded from unattended catalog refresh; after changing the routed +model selection, stop Cline and run `ocx sync` or enable the integration again to refresh it. +A selected model is preserved while still routed and cleared if removed from the exported catalog. + +`CLINE_PROVIDER_SETTINGS_PATH` overrides the primary file. Otherwise `CLINE_DATA_DIR` selects the +data directory, then `CLINE_DIR` selects the root, then `~/.cline` is used. The model file is always +`models.json` beside the selected provider file. Overrides must be absolute or start with `~`. +Mirror command-local Cline `--config` paths with `CLINE_PROVIDER_SETTINGS_PATH` when starting +OpenCodex. A primary path named `models.json` is refused because the files must be distinct. + +Each file replacement is atomic, but no filesystem operation replaces both simultaneously. +One journal operation snapshots both original files; a write or bookkeeping failure compensates +both. An interrupted operation retains a private recovery record. Status reports incomplete +recovery as unsafe, and the next explicit mutation recovers only if neither file nor its +ownership has an unrelated edit. If recovery refuses, preserve the files and the recovery path +reported by the operation; resolve the conflict before retrying. + +Undo restores **both original byte strings**, including a file that originally did not exist. +Edits after the operation require the existing explicit `--confirm-drift`; the edited pair is +backed up first. An occupied OpenCodex entry requires the existing `--overwrite-conflict` opt-in. +Disable removes the two managed entries; it does not restore a prior foreign entry. Use Undo +for that. Snapshot retention and expiration follow the same rules as other integrations. + +The download `cline-config-bundle.json` contains two native document members: `settings` for +`providers.json`, and `catalog` for `models.json`. It is not itself a Cline settings file. Prefer +the integration command for a journaled merge and rollback. Remote admission wiring is not +supported by this generated integration; it requires unauthenticated loopback access. diff --git a/docs-site/src/content/docs/tr/guides/integrations.md b/docs-site/src/content/docs/tr/guides/integrations.md index 03f64377f2..62ec067bb2 100644 --- a/docs-site/src/content/docs/tr/guides/integrations.md +++ b/docs-site/src/content/docs/tr/guides/integrations.md @@ -4,7 +4,7 @@ description: Kontrol panelinden OpenCode, Pi, OMP, Hermes, OpenClaw, Kimi Code, --- **Entegrasyonlar** sekmesi, opencodex'in sağlayıcı bloğunu istemcinin kendi -yapılandırma dosyasına yazar ve tekrar kaldırır. On dört istemci bu şekilde +yapılandırma dosyasına yazar ve tekrar kaldırır. On beş istemci bu şekilde çalışır, her biri bir anahtarla: | İstemci | Yapılandırma dosyası | Format | Değişiklik ne zaman geçerli olur? | Kimlik bilgisi | @@ -23,6 +23,7 @@ yapılandırma dosyasına yazar ve tekrar kaldırır. On dört istemci bu şekil | Aside | `~/.aside/u//models.json` | JSON | Aside tamamen kapatılıp yeniden açıldıktan sonra | geri döngü yer tutucusu | | Raycast | `~/.config/raycast/ai/providers.yaml` | YAML | kaydedildiği anda — Raycast dosyayı izler | yok — yalnızca geri döngü | | omo | `~/.omo/agent/models.json` | JSON | yeni oturumlarda | geri döngü yer tutucusu | +| Cline CLI | `~/.cline/data/settings/providers.json` + `models.json` | JSON | kapatıp yeniden başlattıktan sonra | yalnızca loopback | Yönetilen DSH desteğinin en düşük uyumlu sürümü **DSH 0.1.0-rc.6**'dır. OpenCodex yalnızca `llm-pi-ai.providers.opencodex` bölümünü yönetir: Uygula ve Yenile bu bölümü değiştirir, Devre Dışı @@ -261,3 +262,15 @@ değiştiyse, komut reddeder ve size bildirir; çünkü daha yeni düzenlemeleri doğrulanmıştır; neyin ne zaman denetlendiğine ilişkin `devlog/_fin/260802_client_toggle_api/002_client_toggle_matrix.md` içindeki araştırma notlarına bakın. + +## Cline CLI + +Cline CLI providers.json ve models.json kullanır. Değişiklik veya eşitleme öncesinde Cline’ı kapatın, sonra yeniden başlatın. Geri al iki özgün dosyayı geri yükler. Varsayılan sağlayıcı değişmez. Eski VS Code uzantısının depolaması taşınmaz. + +```bash +ocx integration client enable --client cline +ocx integration client history --client cline +ocx integration client restore --op +``` + +[CLI / rollback / CLINE_PROVIDER_SETTINGS_PATH](/guides/integrations/#cline-cli). diff --git a/docs-site/src/content/docs/zh-tw/guides/integrations.md b/docs-site/src/content/docs/zh-tw/guides/integrations.md index bc9277656f..9d8252b279 100644 --- a/docs-site/src/content/docs/zh-tw/guides/integrations.md +++ b/docs-site/src/content/docs/zh-tw/guides/integrations.md @@ -3,7 +3,7 @@ title: 整合 description: 從儀表板把 opencodex 連接到 OpenCode、Pi、OMP、Hermes、OpenClaw、Kimi Code、gjc、DeepSeek Harness、MiniMax Code、ZCode、Prime Agent、Aside、Raycast 與 omo——每個客戶端一個開關,每次寫入前都會先備份。 --- -**整合(Integrations)** 分頁會把 opencodex 的 provider 區塊寫入客戶端自己的設定檔,也會把它移除。共有十四個客戶端以這種方式運作,每個都有一個開關: +**整合(Integrations)** 分頁會把 opencodex 的 provider 區塊寫入客戶端自己的設定檔,也會把它移除。共有十五個客戶端以這種方式運作,每個都有一個開關: | 客戶端 | 設定檔 | 格式 | 變更生效時機 | 憑證 | |---|---|---|---|---| @@ -21,6 +21,7 @@ description: 從儀表板把 opencodex 連接到 OpenCode、Pi、OMP、Hermes、 | Aside | `~/.aside/u//models.json` | JSON | 完全結束並重新開啟 Aside 後 | loopback 佔位符 | | Raycast | `~/.config/raycast/ai/providers.yaml` | YAML | 儲存後立即生效——Raycast 會監看該檔案 | 無——僅限 loopback | | omo | `~/.omo/agent/models.json` | JSON | 新工作階段 | loopback 佔位符 | +| Cline CLI | `~/.cline/data/settings/providers.json` + `models.json` | JSON | 結束並重新啟動後 | 僅限 loopback | 受管理 DSH 支援的相容性下限是 **DSH 0.1.0-rc.6**。OpenCodex 只擁有 `llm-pi-ai.providers.opencodex`:Apply 與 Refresh 會取代該片段,Disable 只移除該片段, @@ -148,3 +149,15 @@ OAuth 或 API key,並拒絕 `--api-key`、`--base-url` 與 `--region` 覆寫 `--confirm-drift` 永遠不會被擅自假設。如果檔案在你正要回復的操作之後有變更,指令會拒絕並告訴你,因為覆蓋你較新的編輯是你的決定。 客戶端細節是針對各專案自己的設定格式驗證過的;檢查了什麼、何時檢查,請見 `devlog/_fin/260802_client_toggle_api/002_client_toggle_matrix.md` 中的研究筆記。 + +## Cline CLI + +Cline CLI 使用 providers.json 與 models.json。修改或同步前請結束 Cline,完成後重新啟動。復原會還原兩個原始檔案,預設供應商保持不變。此整合不會遷移舊版 VS Code 擴充功能的儲存資料。 + +```bash +ocx integration client enable --client cline +ocx integration client history --client cline +ocx integration client restore --op +``` + +[CLI / rollback / CLINE_PROVIDER_SETTINGS_PATH](/guides/integrations/#cline-cli). diff --git a/gui/src/app-routing.ts b/gui/src/app-routing.ts index cf9762ab71..e2184af3d2 100644 --- a/gui/src/app-routing.ts +++ b/gui/src/app-routing.ts @@ -102,6 +102,7 @@ export const INTEGRATION_TAB_HASHES = [ "integrations/aside", "integrations/raycast", "integrations/omo", + "integrations/cline", ] as const; export function hashBelongsToPage(rawHash: string, page: Page): boolean { diff --git a/gui/src/components/apikeys-workspace/ClientConfigDialog.tsx b/gui/src/components/apikeys-workspace/ClientConfigDialog.tsx index 0d315825f1..e8d1cdefcd 100644 --- a/gui/src/components/apikeys-workspace/ClientConfigDialog.tsx +++ b/gui/src/components/apikeys-workspace/ClientConfigDialog.tsx @@ -78,7 +78,7 @@ export default function ClientConfigDialog({ {t("api.clientConfig.missingLimits", { count: envelope.modelsWithoutLimits, total: envelope.modelCount })}

)} - {!hasKeys && ( + {!hasKeys && client !== "cline" && ( // Informational, never blocking: an agent may legitimately want the shape // first, so both actions stay enabled.

@@ -91,14 +91,14 @@ export default function ClientConfigDialog({

- {t("api.clientConfig.envHint")} + {client !== "cline" && {t("api.clientConfig.envHint")}}
-

{t("api.clientConfig.mergeWarning")}

+

{t(client === "cline" ? "api.clientConfig.clineBundle" : "api.clientConfig.mergeWarning")}

{/* The old
is gone — this is the one place the answer lives now, so it is a labelled paragraph rather than a fold. */}

{t("api.clientConfig.whereDisclosure")}

-

{t("api.clientConfig.whereBody")}

+

{t(client === "cline" ? "integrations.semantics.cline" : "api.clientConfig.whereBody")}