Download packages/api/session-controller/src/file-references.ts from SaylorTwift/deepseek-harness: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/SaylorTwift/deepseek-harness/resolve/main/packages/api/session-controller/src/file-references.ts
- Command line
-
hf download hf://SaylorTwift/deepseek-harness/packages/api/session-controller/src/file-references.ts
-
curl -L -o file-references.ts https://huggingface.co/SaylorTwift/deepseek-harness/resolve/main/packages/api/session-controller/src/file-references.ts
1.52 kB
| /** Session Controller adapter for Agent-scoped file-reference discovery. */ | |
| import type { Context } from '@deepseek-ai/cordis' | |
| import type { Agent } from '@deepseek-ai/dsh-agent' | |
| import type {} from '@deepseek-ai/dsh-file-reference' | |
| import type { FileReferenceCandidate } from '@deepseek-ai/dsh-file-reference/types' | |
| import { Remote, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol' | |
| declare module '@deepseek-ai/cordis' { | |
| interface Context { | |
| /** Host owner of the `fileReferences` Remote namespace. */ | |
| sessionFileReferences: SessionFileReferences | |
| } | |
| } | |
| /** Host Remote adapter over the composed file-reference provider. */ | |
| export class SessionFileReferences extends TypertRemoteService { | |
| static inject = ['fileReferences', 'typert'] | |
| /** @param ctx - Host context carrying the selected file-reference provider. */ | |
| constructor(ctx: Context) { | |
| super(ctx, 'sessionFileReferences', { namespace: 'fileReferences' }) | |
| } | |
| /** | |
| * List file and directory candidates for one Agent's working directory. | |
| * @param agent - target Agent resolved from the Session identity on the wire. | |
| * @param query - path text following `@` or `@"`. | |
| * @param signal - caller cancellation. | |
| * @returns deterministic path-only candidates from the composed provider. | |
| */ | |
| list( | |
| agent: Agent, | |
| query: string, | |
| signal: AbortSignal, | |
| ): Promise<FileReferenceCandidate[]> { | |
| return this.ctx.fileReferences.list(agent, query, signal) | |
| } | |
| } | |
| export default SessionFileReferences | |