Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/core/src/agent-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import type { PluginsConfig } from "./plugin-types";
import type {
AuthProfile,
InstalledProvider,
McpServerConfig,
ModelSelectionState,
Expand Down Expand Up @@ -53,8 +52,6 @@ export interface AgentSettings {
toolsConfig?: ToolsConfig;
/** OpenClaw plugin configuration */
pluginsConfig?: PluginsConfig;
/** Ordered auth profiles (index 0 = primary). Used for multi-provider credential management. */
authProfiles?: AuthProfile[];
/** Installed providers for this agent (index 0 = primary). */
installedProviders?: InstalledProvider[];
/** Enable verbose logging (show tool calls, reasoning, etc.) */
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export type {
AuthProfile,
CliBackendConfig,
ConversationMessage,
DeclaredCredential,
HistoryMessage,
InstalledProvider,
InstructionContext,
Expand Down
20 changes: 19 additions & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export interface CliBackendConfig {

/**
* Unified authentication profile for any model provider.
* Stored in AgentSettings.authProfiles as an ordered array (index 0 = primary).
* Persisted per-(userId, agentId) by the gateway's UserAuthProfileStore;
* also synthesized at read time from declared credentials and SDK-supplied
* ephemeral credentials.
*
* **Invariant:** at any point in time, a profile has **exactly one** credential
* source set — either `credentialRef` (persisted profiles resolved through the
Expand Down Expand Up @@ -91,6 +93,22 @@ export function hasCredentialSource(profile: AuthProfile): boolean {
return Boolean(profile.credential || profile.credentialRef);
}

/**
* Declared provider credential — a credential that ships with the agent's
* declared configuration (`lobu.toml` or SDK `GatewayConfig.agents`).
*
* Declared credentials are read-only at runtime. They are merged into the
* effective auth profile list when no user-scoped profile exists for the
* `(agentId, provider)` pair.
*/
export interface DeclaredCredential {
provider: string;
/** Plaintext key — present when the file/SDK supplies a value directly. */
key?: string;
/** Persisted secret reference — present when the file/SDK supplies a ref. */
secretRef?: SecretRef;
}

export interface SessionContext {
// Core identifiers
platform: string; // Platform identifier (e.g., "slack", "discord", "teams")
Expand Down
Loading
Loading