Download packages/agent-core-v2/src/app/sessionManager/sessionManager.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 2.48 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/app/sessionManager/sessionManager.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/agent-core-v2/src/app/sessionManager/sessionManager.ts
-
curl -L -o sessionManager.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/app/sessionManager/sessionManager.ts
2.48 kB
| import { createDecorator, type ServiceIdentifier } from '#/_base/di/instantiation'; | |
| import type { ISessionScopeHandle } from '#/_base/di/scope'; | |
| import type { Event, IWaitUntil } from '#/_base/event'; | |
| import type { SessionSummary } from '#/app/sessionIndex/sessionIndex'; | |
| import type { SessionMeta } from '#/session/sessionMetadata/sessionMetadata'; | |
| import type { | |
| CreateChildSessionOptions, | |
| CreateSessionOptions, | |
| ForkSessionOptions, | |
| ResumeSessionOptions, | |
| SessionArchivedEvent, | |
| SessionClosedEvent, | |
| SessionCreatedEvent, | |
| SessionForkedEvent, | |
| SessionWillCloseEvent, | |
| SessionWillCreateEvent, | |
| } from '#/workspace/sessionLifecycle/sessionLifecycle'; | |
| export interface CreateManagedSessionOptions extends CreateSessionOptions { | |
| readonly workspaceId?: string; | |
| } | |
| export interface UnguardedSessionLifecycle { | |
| archive(): Promise<void>; | |
| restore(): Promise<ISessionScopeHandle | undefined>; | |
| } | |
| export interface ISessionManager { | |
| readonly _serviceBrand: undefined; | |
| readonly onWillCreateSession?: Event<SessionWillCreateEvent>; | |
| readonly onDidCreateSession?: Event<SessionCreatedEvent & IWaitUntil>; | |
| readonly onWillCloseSession?: Event<SessionWillCloseEvent & IWaitUntil>; | |
| readonly onDidCloseSession?: Event<SessionClosedEvent>; | |
| readonly onWillDeleteSession?: Event<{ readonly sessionId: string } & IWaitUntil>; | |
| readonly onDidArchiveSession?: Event<SessionArchivedEvent>; | |
| readonly onDidForkSession?: Event<SessionForkedEvent>; | |
| create(options: CreateManagedSessionOptions): Promise<ISessionScopeHandle>; | |
| resume(sessionId: string, options?: ResumeSessionOptions): Promise<ISessionScopeHandle | undefined>; | |
| get(sessionId: string): ISessionScopeHandle | undefined; | |
| status(sessionId: string): Promise<SessionSummary | undefined>; | |
| whenResumeSettled(sessionId: string): Promise<void>; | |
| withLifecycleSerialization<T>( | |
| sessionId: string, | |
| work: (unguarded: UnguardedSessionLifecycle) => Promise<T>, | |
| ): Promise<T>; | |
| list(): readonly ISessionScopeHandle[]; | |
| close(sessionId: string): Promise<void>; | |
| archive(sessionId: string): Promise<void>; | |
| restore(sessionId: string, options?: ResumeSessionOptions): Promise<ISessionScopeHandle | undefined>; | |
| delete(sessionId: string): Promise<void>; | |
| fork(options: ForkSessionOptions): Promise<SessionMeta>; | |
| createChild(options: CreateChildSessionOptions): Promise<SessionMeta>; | |
| } | |
| export const ISessionManager: ServiceIdentifier<ISessionManager> = createDecorator<ISessionManager>('sessionManager'); | |