mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-20 04:59:34 +01:00
Merge #806: pick the coding agent per session, with Pi and DeepSeek Harness, and install a missing one
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
commit
f7fccc5dfc
26 files changed
+2013
-113
No files matched your search
@@ -211,6 +211,8 @@ export type LocalModelNextStep = 'retry' | 'other-port' | 'next-model' | 'start'
|
||||
* - `use`: `POST /api/local-model/use`. Listed only while a row of `library` offers it.
|
||||
* - `delete-model`: `DELETE /api/local-model/models`. Listed only while a row of `library`
|
||||
* offers it.
|
||||
* - `install-agent`: `POST /api/local-model/agent`. Listed only while a row of `harnesses`
|
||||
* offers it.
|
||||
*/
|
||||
export type LocalModelAction =
|
||||
| 'install'
|
||||
@@ -221,7 +223,8 @@ export type LocalModelAction =
|
||||
| 'remove'
|
||||
| 'start-session'
|
||||
| 'use'
|
||||
| 'delete-model';
|
||||
| 'delete-model'
|
||||
| 'install-agent';
|
||||
|
||||
/** Whether the Mac has the developer tools (git, Python) a coding agent calls. */
|
||||
export type LocalModelDeveloperTools =
|
||||
@@ -301,7 +304,7 @@ export const LOCAL_MODEL_INSTALL_LABELS = {
|
||||
refusedNotInLibrary: 'This model is not one of the checked models on this Mac.',
|
||||
refusedNotOnThisMac: 'This model is not on this Mac.',
|
||||
deleteFailed: '{model} could not be deleted from this Mac.',
|
||||
refusedAgentMissing: '{cli} is not installed on this Mac. Install this model again to choose a coding agent.',
|
||||
refusedAgentMissing: '{cli} is not installed on this Mac. Install a coding agent in the local model window first.',
|
||||
endpointManaged:
|
||||
'This endpoint belongs to the model Codeman runs on this Mac. Change or remove it in the local model window.',
|
||||
endpointIdReserved: 'This endpoint id is reserved for the model Codeman runs on this Mac. Pick another id.',
|
||||
@@ -461,8 +464,9 @@ export interface LocalModelLoadedFacts {
|
||||
* | `port` | | once chosen | once chosen | once chosen | yes |
|
||||
* | `loaded`, `endpointId` | | | | | yes |
|
||||
*
|
||||
* `running`, `developerTools`, `runtime`, `folder`, `library` and `actions` are always
|
||||
* present. `store` is present once the model store was measured.
|
||||
* `running`, `developerTools`, `runtime`, `folder`, `library`, `harnesses` and `actions` are
|
||||
* always present. `store` is present once the model store was measured. `harnesses` is empty
|
||||
* in every state but `installed`.
|
||||
*/
|
||||
export interface LocalModelInstallView {
|
||||
state: LocalModelInstallState;
|
||||
@@ -473,7 +477,11 @@ export interface LocalModelInstallView {
|
||||
progress?: LocalModelProgress;
|
||||
error?: LocalModelInstallError;
|
||||
model?: LocalModelInstalledModel;
|
||||
/** The coding agent: a CLI registry id, as data. */
|
||||
/**
|
||||
* The coding agent of the job, and on an installed model the DEFAULT one: the agent it was
|
||||
* installed with, which a client that names no agent starts. A CLI registry id, as data.
|
||||
* `harnesses` lists every agent a session can be started with.
|
||||
*/
|
||||
cli?: string;
|
||||
/** The coding agent's display label ('OpenCode'). */
|
||||
cliLabel?: string;
|
||||
@@ -498,10 +506,74 @@ export interface LocalModelInstallView {
|
||||
library: LocalModelLibraryRow[];
|
||||
/** What the model store takes on disk right now. Present in every state once it was measured. */
|
||||
store?: LocalModelStoreView;
|
||||
/**
|
||||
* The coding agents a session on the model in use can be started with: every catalogue
|
||||
* harness that works at the model's context and accepts its name, the default one (`cli`)
|
||||
* first, then by catalogue rank. The agent is chosen per session, so a row is not a setting.
|
||||
* Empty in every state but `installed`.
|
||||
*/
|
||||
harnesses: LocalModelHarnessRow[];
|
||||
/** What the server accepts right now, see `LocalModelAction`. */
|
||||
actions: LocalModelAction[];
|
||||
}
|
||||
|
||||
/**
|
||||
* How a coding agent of `harnesses` stands on this Mac.
|
||||
* - `ready`: it can be started (the same answer the Run menu gets).
|
||||
* - `installable`: it is not on this Mac, and `POST /api/local-model/agent` installs it with
|
||||
* `installCommand`.
|
||||
* - `installing`: that install is running. It runs beside the model: nothing about the model
|
||||
* in use changes, and a session with another agent can be started meanwhile.
|
||||
* - `setup-needed`: it is not startable and one command does not make it so (a launcher
|
||||
* without a profile, or a command that needs an administrator). Its own setup is in the Run
|
||||
* menu or in a terminal; nothing is offered here.
|
||||
*/
|
||||
export type LocalModelHarnessStatus = 'ready' | 'installable' | 'installing' | 'setup-needed';
|
||||
|
||||
/** What can be done with one row of `harnesses`: start a session with it, or `POST /api/local-model/agent`. */
|
||||
export type LocalModelHarnessAction = 'start-session' | 'install';
|
||||
|
||||
/** One coding agent the model in use can be run with. Everything a client needs is here, so it compares no CLI id. */
|
||||
export interface LocalModelHarnessRow {
|
||||
/** The CLI registry id, as data: the `mode` of a session started with it, and the `cli` of `POST /api/local-model/agent`. */
|
||||
cli: string;
|
||||
/** The registry's display label ('OpenCode'). */
|
||||
cliLabel: string;
|
||||
/** True on the row `LocalModelInstallView.cli` names. */
|
||||
default: boolean;
|
||||
status: LocalModelHarnessStatus;
|
||||
/**
|
||||
* The literal command `POST /api/local-model/agent` would run: the STOCK command of the CLI
|
||||
* registry for this platform. Present exactly when `status` is `installable` or `installing`.
|
||||
* The consent prints it as it is.
|
||||
*/
|
||||
installCommand?: string;
|
||||
/** The harness row's `slowFirstTurn`: the first answer takes minutes. */
|
||||
slowFirstTurn?: boolean;
|
||||
/**
|
||||
* A literal with no white space the agent's composer draws once it takes input
|
||||
* (`LocalHarnessEntry.readyMark`, else the CLI registry's `composerReadyMark`): what a script
|
||||
* waits for on `GET /api/sessions/:id/wait-output` before it sends the first prompt. Absent
|
||||
* for an agent with no measured mark.
|
||||
*/
|
||||
readyMark?: string;
|
||||
/**
|
||||
* The last install of this agent through `POST /api/local-model/agent` failed, and it is
|
||||
* still not on this Mac. Kept in memory only: a restart of the server forgets it.
|
||||
*/
|
||||
error?: LocalModelAgentError;
|
||||
/** What the server accepts for this row right now. */
|
||||
actions: LocalModelHarnessAction[];
|
||||
}
|
||||
|
||||
/** Why an install of a coding agent from an installed model failed. */
|
||||
export interface LocalModelAgentError {
|
||||
/** `errHarnessFailed` with the agent's label. */
|
||||
message: LocalModelInstallMessage;
|
||||
/** The end of what the installer printed, as it is (English or the tool's own language). */
|
||||
detail?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* How a model of the library stands.
|
||||
* - `ready`: checked by Codeman, and the runtime (when it was asked) still lists it with the
|
||||
@@ -612,6 +684,15 @@ export interface LocalModelDeleteRequest {
|
||||
modelId: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Body of `POST /api/local-model/agent`: a coding agent of `harnesses` to install beside an
|
||||
* installed model. The click that sends it is the consent to the row's `installCommand`.
|
||||
*/
|
||||
export interface LocalModelAgentRequest {
|
||||
/** `LocalModelHarnessRow.cli` of a row whose `actions` list `install`. */
|
||||
cli: string;
|
||||
}
|
||||
|
||||
/** The `data` of a 400 the service names: its sentence, for the window to print in its own language. */
|
||||
export interface LocalModelRefusal {
|
||||
message: LocalModelInstallMessage;
|
||||
|
||||
@@ -207,6 +207,15 @@ export interface LocalHarnessEntry {
|
||||
gated?: boolean;
|
||||
/** True: the first answer takes minutes, because the harness sends a very large fixed prompt. */
|
||||
slowFirstTurn?: boolean;
|
||||
/**
|
||||
* A literal with no white space that this harness's composer draws once it takes input, and
|
||||
* nothing before it does: what a script waits for before it sends the first prompt
|
||||
* (`GET /api/sessions/:id/wait-output`). Only a mark that was MEASURED on a session started
|
||||
* on a custom model goes here. Absent: the CLI registry's own
|
||||
* `capabilities.composerReadyMark` is used when it declares one, and a harness with neither
|
||||
* has no mark.
|
||||
*/
|
||||
readyMark?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -248,9 +257,18 @@ export interface HarnessFact {
|
||||
cli: string;
|
||||
/** The registry's display label ('OpenCode'). */
|
||||
label: string;
|
||||
/** The CLI's binary was found on this machine. */
|
||||
/**
|
||||
* The CLI can be started on this machine: the same answer the Run menu gets. For a launcher
|
||||
* that starts nothing by itself (`discovery.launcherProfile` in the CLI registry) that is its
|
||||
* binary AND something for it to launch.
|
||||
*/
|
||||
installed: boolean;
|
||||
/** Not installed, but the registry has an install command for this platform that needs no administrator rights. */
|
||||
/**
|
||||
* Not installed, but ONE command makes it startable: the registry has an install command for
|
||||
* this platform that needs no administrator rights, and the CLI is not a launcher. A launcher
|
||||
* needs a second install the command does not make (a profile, which is third-party code
|
||||
* with a consent of its own), so it is never installable from here.
|
||||
*/
|
||||
installable: boolean;
|
||||
/**
|
||||
* The literal install command the install job would run for this CLI: the STOCK
|
||||
@@ -259,6 +277,8 @@ export interface HarnessFact {
|
||||
* (`CandidateHarness.installCommand`).
|
||||
*/
|
||||
installCommand?: string;
|
||||
/** The registry's `capabilities.composerReadyMark`, when the CLI declares one and it holds no white space. */
|
||||
readyMark?: string;
|
||||
/** Whether this CLI can be launched with that model id (its command-line pattern accepts it). */
|
||||
acceptsModelId: (modelId: string) => boolean;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user