Merge master and reconcile declarative presets with activations

This commit is contained in:
Dudu-0223 committed 2026-09-21 16:41:53 +08:00
commit 307c75011b
297 files changed
+4130 -11916

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ import type {
Agent, AgentOptions, AgentSetup, ModelSelection as AgentModelSelection, ModelSelectionRef,
} from '@deepseek-ai/dsh-agent'
import type {} from '@deepseek-ai/dsh-agent-default-model'
import type {} from '@deepseek-ai/dsh-agent-presets'
import type {} from '@deepseek-ai/dsh-agent-preset-registry'
import { ReasoningEffortId } from '@deepseek-ai/dsh-llm'
import type { Session, SessionId } from '@deepseek-ai/dsh-session'
import type { SessionInspection } from '@deepseek-ai/dsh-session-persistence'
+1 -1
View File
@@ -1,7 +1,7 @@
/** Cold-safe Session list and search projection. */
import type { Context } from '@deepseek-ai/cordis'
import type {} from '@deepseek-ai/dsh-agent-presets'
import type {} from '@deepseek-ai/dsh-agent-preset-registry'
import type { ImageAttachmentLimits } from '@deepseek-ai/dsh-attachment'
import type { Session, SessionEvent, SessionHeader, SessionId } from '@deepseek-ai/dsh-session'
import type { ProjectionSnapshot } from '@deepseek-ai/dsh-session-projection'
@@ -1,8 +1,7 @@
/** Session-addressed, cold-readable skill catalog Remote. */
import type { Context } from '@deepseek-ai/cordis'
import type {} from '@deepseek-ai/dsh-agent-presets/types'
import type { SessionId } from '@deepseek-ai/dsh-session'
import type {} from '@deepseek-ai/dsh-agent-preset-registry/types'
import { SessionQueryError } from '@deepseek-ai/dsh-session-query'
import { isUserInvocable } from '@deepseek-ai/dsh-skill'
import type { ScopeKey } from '@deepseek-ai/dsh-scope'
@@ -72,7 +71,8 @@ export class SessionSkillCatalog extends TypertRemoteService {
)
}
const scope = await this.scopeFor(sessionId, agentPreset)
await using lease = live === undefined ? await this.scopeFor(agentPreset) : undefined
const scope = live ?? lease?.key
try {
const skills = (await skillRegistry.list({ cwd, scope })).filter(isUserInvocable)
return {
@@ -91,15 +91,12 @@ export class SessionSkillCatalog extends TypertRemoteService {
/** Resolve a live or standing preset scope without creating an Agent. */
private async scopeFor(
sessionId: SessionId,
agentPreset: string | undefined,
): Promise<ScopeKey | undefined> {
const live = this.ctx.agents.get(sessionId)
if (live !== undefined) return live
): Promise<({ key: ScopeKey } & AsyncDisposable) | undefined> {
const presets = this.ctx.get('agentPresets')
if (presets === undefined) return undefined
try {
return await presets.standingKeyFor(agentPreset)
return await presets.acquireScope(agentPreset)
} catch {
// An unknown or unusable recorded preset falls back to the global registry.
return undefined