refactor: apply repository naming contract

Apply the accepted pre-release package, service, type, directory, and role renames as one repository-wide change.
This commit is contained in:
Tianyi Cui
2026-08-13 00:36:22 +08:00
parent 101df7cf58
commit a2d0f7f411
3281 changed files with 21730 additions and 21592 deletions

View File

@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/core/agent-default-model/README.md
README.md: e86be7c37a1f994ca52f018144ef6a2409bd1eea
README.zh.md: 00250c28ef8c03d4b33fe1c1bfca138a022f6638
README.md: 4b9e06c1f68150633afa8aad752845f6d96dda85
README.zh.md: f3b8acb1a64e9a80aece87ac71f49a963d573352

View File

@@ -2,7 +2,7 @@
English | [中文](README.zh.md)
The deployment default used when an entry point creates an Agent that has no session-local model selection. `AgentDefaultModelService` provides `ctx.agentDefaultModel`; direct entry points such as `dsh --profile headless` and Host-backed entry points such as ApiProxy read the same service instead of owning parallel provider/model defaults.
The deployment default used when an entry point creates an Agent that has no session-local model selection. `AgentDefaultModelConfig` provides `ctx.agentDefaultModel`; direct entry points such as `dsh --profile headless` and Host-backed entry points such as ApiProxy read the same service instead of owning parallel provider/model defaults.
The plugin config requires `{ provider, model }`. That composition entry is the base of the `agent-default-model` Settings section; a mounted settings provider layers the user's choice over it and changes are visible on the next `currentSelection()` read. `reasoningEffort` belongs to the Settings section but deliberately not to plugin config: a complete saved selection can clear an effort when the next selected model has none, while a composition value would be inherited again.

View File

@@ -2,7 +2,7 @@
[English](README.md) | 中文
该部署默认值供入口在创建尚无会话级模型选择的 Agent 时使用。`AgentDefaultModelService` 提供 `ctx.agentDefaultModel``dsh --profile headless` 这类直接入口与 ApiProxy 这类由 Host 支撑的入口读取同一服务,而不是分别持有平行的提供方/模型默认值。
该部署默认值供入口在创建尚无会话级模型选择的 Agent 时使用。`AgentDefaultModelConfig` 提供 `ctx.agentDefaultModel``dsh --profile headless` 这类直接入口与 ApiProxy 这类由 Host 支撑的入口读取同一服务,而不是分别持有平行的提供方/模型默认值。
插件配置必须提供 `{ provider, model }`。该组合配置项构成 Settings 中 `agent-default-model` 分节的基础层;挂载的设置提供方在其上叠加用户选择,更改会在下一次调用 `currentSelection()` 时可见。`reasoningEffort` 属于该 Settings 分节但特意不属于插件配置完整保存的选择必须能在下一个选定模型没有推理reasoning强度时清除旧值而组合配置值会再次被继承。

View File

@@ -13,7 +13,7 @@ import { installSettingsSection, settingsNamespace } from '@deepseek-ai/dsh-sett
declare module '@deepseek-ai/cordis' {
interface Context {
/** Default model selection for Agents created without an explicit model. */
agentDefaultModel: AgentDefaultModelService
agentDefaultModel: AgentDefaultModelConfig
}
}
@@ -61,7 +61,7 @@ function selection(settings: AgentDefaultModelSettings): ModelSelection {
* The composition entry remains usable without a settings provider; when one
* is mounted, its user layer is read live.
*/
export class AgentDefaultModelService extends Service {
export class AgentDefaultModelConfig extends Service {
static Config: z<Config> = z.object({
provider: z.string().required(),
model: z.string().required(),
@@ -104,4 +104,4 @@ export class AgentDefaultModelService extends Service {
}
}
export default AgentDefaultModelService
export default AgentDefaultModelConfig

View File

@@ -2,13 +2,13 @@
import { describe, expect, it } from 'vitest'
import { Context } from '@deepseek-ai/cordis'
import AgentDefaultModelService, { AGENT_DEFAULT_MODEL_SETTINGS_NAMESPACE } from '../src/index.ts'
import { Settings } from '@deepseek-ai/dsh-settings'
import AgentDefaultModelConfig, { AGENT_DEFAULT_MODEL_SETTINGS_NAMESPACE } from '../src/index.ts'
import { SettingsProvider } from '@deepseek-ai/dsh-settings'
import type { SettingsNamespace } from '@deepseek-ai/dsh-settings'
import { ReasoningEffortId } from '@deepseek-ai/dsh-llm'
/** The smallest real provider: one in-memory document, always writable. */
class MemorySettings extends Settings {
class MemorySettings extends SettingsProvider {
doc: Record<string, unknown> = {}
get writable(): boolean {
@@ -28,19 +28,19 @@ class MemorySettings extends Settings {
async function boot(): Promise<{
ctx: Context
settingsFiber: Context['fiber']
defaultModel: AgentDefaultModelService
defaultModel: AgentDefaultModelConfig
}> {
const ctx = new Context()
const settingsFiber = ctx.plugin(MemorySettings)
await settingsFiber.await()
await ctx.plugin(AgentDefaultModelService, {
await ctx.plugin(AgentDefaultModelConfig, {
provider: 'deepseek-official',
model: 'deepseek-v4-flash',
})
return { ctx, settingsFiber, defaultModel: ctx.agentDefaultModel }
}
describe('AgentDefaultModelService', () => {
describe('AgentDefaultModelConfig', () => {
it('resolves the user layer over the composition entry', async () => {
const bench = await boot()
expect(bench.defaultModel.currentSelection()).toEqual({
@@ -90,7 +90,7 @@ describe('AgentDefaultModelService', () => {
it('keeps the composition entry when no settings provider is mounted', async () => {
const ctx = new Context()
await ctx.plugin(AgentDefaultModelService, { provider: 'p', model: 'm' })
await ctx.plugin(AgentDefaultModelConfig, { provider: 'p', model: 'm' })
await ctx.agentDefaultModel.saveSelection({ provider: 'other', model: 'other' })
expect(ctx.agentDefaultModel.currentSelection()).toEqual({ provider: 'p', model: 'm' })
await ctx.fiber.dispose()

View File

@@ -24,7 +24,7 @@
"path": "../../settings/settings"
},
{
"path": "../../support/invariants"
"path": "../../runtime-diagnostics/invariants"
}
]
}