@deepseek-ai/dsh-file-reference 0.1.1-rc.1 → 0.1.2-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/context/file-reference/README.md
5
- README.md: ae0e1ef68f927890af78767660cac094d831380c
6
- README.zh.md: 1645dd345cd52cf5d3e02270c1fbd4c4344ada37
5
+ README.md: 7571aecbc42cdcda39a2c7ad5416205e7f4c108c
6
+ README.zh.md: ad13336f47b3069fd35e75eb2aed994221bb9e3c
package/README.md CHANGED
@@ -1,22 +1,112 @@
1
- # `@deepseek-ai/dsh-file-reference`
1
+ ---
2
+ description: "File-reference discovery and @file mention grammar for host-backed UIs, for users and maintainers choosing the seam or pairing it with a provider."
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @deepseek-ai/dsh-file-reference
2
7
 
3
8
  English | [中文](README.zh.md)
4
9
 
5
- File-reference discovery seam and browser-safe `@file` grammar shared by host-backed user interfaces. `ctx.fileReferences.list(agent, query, signal)` returns path-only file or directory candidates for the addressed agent; concrete providers own namespace access, ranking, caching, and invalidation. The same contract is remotely callable as the unary `fileReferences/list` Remote method (`@Remote` on the Service Definition, cancelled through the reserved trailing signal), so browser consumers call `ctx.remote.fileReferences.list` without an API Proxy route.
10
+ ## Summary
11
+
12
+ Host-backed user interfaces use `dsh-file-reference` to offer `@file` completion: a UI asks for path candidates for the addressed agent, the model types `@path` or `@"path with spaces"`, and picking a candidate inserts the matching mention as ordinary prompt text. The seam itself owns no filesystem access — a concrete provider such as `@deepseek-ai/dsh-file-reference-local` supplies candidates, ranking, caching, and invalidation. Selecting a candidate never reads or attaches file contents; the model must call a filesystem tool to inspect a file. Session Controller exposes the same discovery to browser consumers through the `fileReferences/list` Remote.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Further Exploration](#further-exploration)
19
+ - [Model Experience](#model-experience)
20
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
21
+ - [Dev Note](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## Use this package
27
+
28
+ Choose this package when a host-backed UI (web or terminal) should offer `@file` completion, and pair it with a provider whose namespace matches the agent's effective `read` tool. Mounting the seam without a provider gives the UI an empty completion surface.
29
+
30
+ ### Mention grammar
31
+
32
+ An `@path` token at the start of input or after whitespace triggers completion; an `@` inside another token, such as an email address, does not. `@"path with spaces"` opens a quoted mention, and a directory candidate keeps that quote open after its trailing slash so completion can descend another level. The formatter rejects paths with control characters or embedded quotes that the grammar cannot represent safely.
33
+
34
+ ### Getting candidates
35
+
36
+ `ctx.fileReferences.list(agent, query, signal)` returns path-only file and directory candidates for one agent's working directory, deterministically ranked by the provider. Directory mentions render with a trailing `/` so completion can descend another level. Browser consumers call the Session Controller adapter as `ctx.remote.fileReferences.list`; the trailing signal cancels a slow autocomplete.
37
+
38
+ ### Pairing with a provider
39
+
40
+ For a local filesystem, mount `@deepseek-ai/dsh-file-reference-local`; other namespaces (remote or virtual filesystems) need a provider whose discovery matches the effective tool. When the addressed agent can call `read`, a provider may install the stable `FILE_REFERENCE_PROMPT` guidance that tells the model to read a referenced file before claiming to have inspected it.
41
+
42
+ -----
43
+
44
+ <a id="understand-the-implementation"></a>
45
+ ## Understand the implementation
46
+
47
+ <details>
48
+ <summary>Implementation internals — click to expand</summary>
49
+
50
+ This section explains the design of the seam; the observable behavior is covered in [Use this package](#use-this-package).
6
51
 
7
- `activeAtToken()` recognizes an `@path` or open `@"path with spaces` token only at the start of input or after whitespace, so email-like text does not open completion. `formatFileMention()` emits the matching prompt spelling, appends `/` to directory candidates, preserves an explicitly opened quote, and rejects control characters or embedded quotes that the editor grammar cannot represent safely.
52
+ ### Design concept
8
53
 
9
- Selecting a candidate does not read or attach file contents. The exported `FILE_REFERENCE_PROMPT` is stable guidance that a provider may install when the addressed agent can call `read`.
54
+ The package separates an abstract discovery service from a shared, browser-safe mention grammar, with providers owning namespace access, ranking, caching, and invalidation. The service remains wire-neutral; `dsh-api-session-controller` owns the `fileReferences/list` Remote adapter and delegates to the active provider after resolving its Agent.
10
55
 
56
+ ### Source map
57
+
58
+ | File | Role |
59
+ |---|---|
60
+ | [`src/index.ts`](src/index.ts) | Abstract `FileReferenceService` and `FILE_REFERENCE_PROMPT` |
61
+ | [`src/grammar.ts`](src/grammar.ts) | `activeAtToken` recognition and `formatFileMention` rendering |
62
+ | [`src/types.ts`](src/types.ts) | `FileReferenceCandidate` path-only result type |
63
+ | [`src/invariant.ts`](src/invariant.ts) | Invariant companion for the discovery contract |
64
+
65
+ ### Main flow
66
+
67
+ The UI recognizes an active `@` token through `activeAtToken`, calls `list` with the query text, and renders the ranked candidates. On selection, `formatFileMention` emits the matching prompt spelling (`@path`, `@"path with spaces"`, or an open `@"dir/` for a quoted directory). No file content is read at any point; providers may additionally install the stable `FILE_REFERENCE_PROMPT` section when the addressed agent has a `read` tool.
68
+
69
+ </details>
70
+
71
+ -----
72
+
73
+ <a id="further-exploration"></a>
74
+ ## Further Exploration
75
+
76
+ Read these pages when the package-level contract is not enough. They move from the shipped provider to the shared reference surface and the tools the candidates point at.
77
+
78
+ - [Local file-reference provider](../file-reference-local/README.md) — the shipped local-workspace implementation of this seam.
79
+ - [Session-reference subsystem](../../../docs/subsystems/session-reference.md) — the shared file-reference and session-reference contracts behind host UIs.
80
+ - [Context group map](../README.md) — sibling request-context packages.
81
+ - [Filesystem tool catalog](../../../docs/tool-catalog.md#deepseek-aidsh-tool-fs) — the `read` tool that referenced paths are meant for.
82
+
83
+ -----
84
+
85
+ <a id="model-experience"></a>
11
86
  ## Model Experience
12
87
 
13
- Indirectly, through `@deepseek-ai/dsh-file-reference-local`, which conditionally contributes this package's stable file-reference guidance.
88
+ Indirectly, through the composed provider, which owns the file-reference guidance that this package's discovery seam and grammar delegate to it.
14
89
 
15
90
  #### KV Cache effect
16
91
 
17
- The interface and grammar add no request tokens themselves; a provider-owned prompt section determines cache behavior.
92
+ The interface and grammar add no request tokens; a provider-owned prompt section determines whether the reusable prefix changes.
18
93
 
19
94
  ## Known Limitations and Deferred Work
20
95
 
96
+ <a id="known-limitations-and-deferred-work"></a>
97
+
98
+
99
+ These limits define when the seam is a poor fit. They are current package constraints.
100
+
21
101
  - **Path candidates are advisory** — the seam does not prove that a later model-facing filesystem tool can access the same namespace; deployments must align the provider with the effective `read` implementation.
22
102
  - **No file-content reference object** — selected files remain ordinary prompt text and require an explicit model tool call before their contents become model-visible.
103
+
104
+ <a id="dev-note"></a>
105
+ ### Dev Note
106
+
107
+ <details>
108
+ <summary>Working context for maintainers — click to expand</summary>
109
+
110
+ None.
111
+
112
+ </details>
package/README.zh.md CHANGED
@@ -1,22 +1,112 @@
1
- # `@deepseek-ai/dsh-file-reference`
1
+ ---
2
+ description: "面向宿主驱动 UI 的文件引用发现与 @file mention 语法,供选择该 seam 或为其搭配提供方的用户与维护者阅读。"
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @deepseek-ai/dsh-file-reference
2
7
 
3
8
  [English](README.md) | 中文
4
9
 
5
- 文件引用发现 seam,以及供宿主驱动的用户界面共享、可在浏览器中安全使用的 `@file` 语法。`ctx.fileReferences.list(agent, query, signal)` 为指定 agent(智能体)返回仅含路径的文件或目录候选;具体提供方负责命名空间访问、排序、缓存和失效处理。同一契约以一元 `fileReferences/list` Remote 方法对外可调(`@Remote` 标注在 Service Definition 上,经保留的末位 signal 参数取消),浏览器消费方直接调用 `ctx.remote.fileReferences.list`,无需 API Proxy 路由。
10
+ ## 概述
11
+
12
+ 宿主驱动 UI 使用 `dsh-file-reference` 提供 `@file` 补全:UI 为指定 agent 请求路径候选,模型输入 `@path` 或 `@"path with spaces"`,选中候选后,匹配的 mention 作为普通提示词文本插入。seam 本身不拥有文件系统访问——具体提供方(如 `@deepseek-ai/dsh-file-reference-local`)负责提供候选、排序、缓存与失效。选中候选绝不读取或附带文件内容;模型必须调用文件系统工具才能查看文件。Session Controller 通过 `fileReferences/list` Remote 向浏览器消费方暴露同一发现能力。
13
+
14
+ ## 目录
15
+
16
+ - [使用本包](#use-this-package)
17
+ - [理解实现](#understand-the-implementation)
18
+ - [进一步探索](#further-exploration)
19
+ - [模型体验](#model-experience)
20
+ - [已知限制与延期工作](#known-limitations-and-deferred-work)
21
+ - [开发备注](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## 使用本包
27
+
28
+ 当宿主驱动 UI(Web 或终端)需要提供 `@file` 补全时选择本包,并搭配一个命名空间与 agent 实际生效的 `read` 工具一致的提供方。单独挂载该 seam 而没有提供方时,UI 只能得到空的补全列表。
29
+
30
+ ### mention 语法
31
+
32
+ 输入开头或空白后的 `@path` token 会触发补全;其他 token 内部的 `@`(如电子邮件地址)不会。`@"path with spaces"` 打开带引号的 mention,目录候选在其尾斜杠后保持引号打开,使补全可以继续深入下一层。格式化器会拒绝语法无法安全表示的控制字符或内嵌引号路径。
33
+
34
+ ### 获取候选
35
+
36
+ `ctx.fileReferences.list(agent, query, signal)` 返回指定 agent 工作目录中仅含路径的文件与目录候选,由提供方确定性地排序。目录 mention 呈现时带尾随 `/`,使补全可以继续深入下一层。浏览器消费方通过 Session Controller adapter 的 `ctx.remote.fileReferences.list` 调用同一发现能力;末位 signal 参数可取消慢速自动补全。
37
+
38
+ ### 搭配提供方
39
+
40
+ 本地文件系统请挂载 `@deepseek-ai/dsh-file-reference-local`;其他命名空间(远程或虚拟文件系统)需要发现能力与生效工具一致的提供方。当指定 agent 可以调用 `read` 时,提供方可以安装稳定的 `FILE_REFERENCE_PROMPT` 指引,告诉模型先读取被引用文件、再声称检查过它。
41
+
42
+ -----
43
+
44
+ <a id="understand-the-implementation"></a>
45
+ ## 理解实现
46
+
47
+ <details>
48
+ <summary>实现细节——点击展开</summary>
49
+
50
+ 本节解释该 seam 的设计;可观察行为见[使用本包](#use-this-package)。
6
51
 
7
- `activeAtToken()` 只在输入开头或空白后识别 `@path` 或尚未闭合的 `@"path with spaces` token,因此类似电子邮件的文本不会打开补全。`formatFileMention()` 会生成与提示词匹配的写法,为目录候选追加 `/`,保留显式打开的引号,并拒绝编辑器语法无法安全表示的控制字符或内嵌引号。
52
+ ### 设计理念
8
53
 
9
- 选择候选项不会读取或附加文件内容。导出的 `FILE_REFERENCE_PROMPT` 是稳定指引;当指定 agent 可以调用 `read` 时,提供方可以安装该指引。
54
+ 本包把抽象发现服务与共享、浏览器安全的 mention 语法分开,由提供方负责命名空间访问、排序、缓存与失效。该服务保持 wire 中立;`dsh-api-session-controller` 持有 `fileReferences/list` Remote adapter,并在解析 Agent 后委派给当前 provider。
10
55
 
56
+ ### 源码地图
57
+
58
+ | 文件 | 职责 |
59
+ |---|---|
60
+ | [`src/index.ts`](src/index.ts) | 抽象 `FileReferenceService` 与 `FILE_REFERENCE_PROMPT` |
61
+ | [`src/grammar.ts`](src/grammar.ts) | `activeAtToken` 识别与 `formatFileMention` 渲染 |
62
+ | [`src/types.ts`](src/types.ts) | 仅含路径的结果类型 `FileReferenceCandidate` |
63
+ | [`src/invariant.ts`](src/invariant.ts) | 发现约定的不变式伴生插件 |
64
+
65
+ ### 主要流程
66
+
67
+ UI 通过 `activeAtToken` 识别活动 `@` token,用查询文本调用 `list`,再渲染排序后的候选。选中后,`formatFileMention` 发出匹配的提示词写法(`@path`、`@"path with spaces"`,或带引号目录的开放形式 `@"dir/`)。任何环节都不读取文件内容;当指定 agent 拥有 `read` 工具时,提供方还可以安装稳定的 `FILE_REFERENCE_PROMPT` 提示词段。
68
+
69
+ </details>
70
+
71
+ -----
72
+
73
+ <a id="further-exploration"></a>
74
+ ## 进一步探索
75
+
76
+ 包级约定不够用时阅读以下页面。它们从随附提供方进入共享引用表面,以及候选所指向的工具。
77
+
78
+ - [本地文件引用提供方](../file-reference-local/README.zh.md)——本 seam 的随附本地工作区实现。
79
+ - [会话引用子系统](../../../docs/subsystems/session-reference.zh.md)——宿主 UI 背后的共享文件引用与会话引用约定。
80
+ - [context 组地图](../README.zh.md)——相邻的请求上下文包。
81
+ - [文件系统工具目录](../../../docs/tool-catalog.zh.md#deepseek-aidsh-tool-fs)——被引用路径所对应的 `read` 工具。
82
+
83
+ -----
84
+
85
+ <a id="model-experience"></a>
11
86
  ## 模型体验
12
87
 
13
- 间接影响模型体验:`@deepseek-ai/dsh-file-reference-local` 会按条件贡献本包的稳定文件引用指引。
88
+ 间接影响模型体验:本包的发现 seam 与语法把文件引用指引委托给组合的提供方,由它负责呈现。
89
+
90
+ #### KV Cache 影响
91
+
92
+ 接口与语法本身不增加请求 token;提供方拥有的提示词段决定可复用前缀是否改变。
93
+
94
+ ## 已知限制与延期工作
14
95
 
15
- #### KV 缓存影响
96
+ <a id="known-limitations-and-deferred-work"></a>
16
97
 
17
- 接口和语法本身不会增加请求 token;缓存行为取决于提供方拥有的提示词段。
18
98
 
19
- ## 已知限制与暂缓事项
99
+ 这些限制说明该 seam 何时不合适。它们是当前包约束。
20
100
 
21
101
  - **路径候选仅供参考**:该 seam 不保证后续面向模型的文件系统工具能够访问同一命名空间;部署时必须让提供方与实际生效的 `read` 实现对齐。
22
102
  - **没有文件内容引用对象**:所选文件仍是普通提示词文本,其内容必须经过模型显式调用工具后才对模型可见。
103
+
104
+ <a id="dev-note"></a>
105
+ ### 开发备注
106
+
107
+ <details>
108
+ <summary>维护者的工作上下文——点击展开</summary>
109
+
110
+ 无。
111
+
112
+ </details>
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
1
+ import { Service } from "@deepseek-ai/cordis";
2
2
  //#region lib/types/grammar.js
3
3
  /**
4
4
  * Browser-safe `@file` token grammar shared by terminal and web clients.
@@ -50,89 +50,13 @@ function formatFileMention(candidate, preserveQuote) {
50
50
  *
51
51
  * @module @deepseek-ai/dsh-file-reference
52
52
  */
53
- var __runInitializers = function(thisArg, initializers, value) {
54
- var useValue = arguments.length > 2;
55
- for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
56
- return useValue ? value : void 0;
57
- };
58
- var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
59
- function accept(f) {
60
- if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
61
- return f;
62
- }
63
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
64
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
65
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
66
- var _, done = false;
67
- for (var i = decorators.length - 1; i >= 0; i--) {
68
- var context = {};
69
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
70
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
71
- context.addInitializer = function(f) {
72
- if (done) throw new TypeError("Cannot add initializers after decoration has completed");
73
- extraInitializers.push(accept(f || null));
74
- };
75
- var result = (0, decorators[i])(kind === "accessor" ? {
76
- get: descriptor.get,
77
- set: descriptor.set
78
- } : descriptor[key], context);
79
- if (kind === "accessor") {
80
- if (result === void 0) continue;
81
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
82
- if (_ = accept(result.get)) descriptor.get = _;
83
- if (_ = accept(result.set)) descriptor.set = _;
84
- if (_ = accept(result.init)) initializers.unshift(_);
85
- } else if (_ = accept(result)) if (kind === "field") initializers.unshift(_);
86
- else descriptor[key] = _;
87
- }
88
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
89
- done = true;
90
- };
91
53
  /** Model guidance for path-only references selected by a user interface. */
92
- const FILE_REFERENCE_PROMPT = "Paths prefixed with @ are files explicitly referenced by the user. Use the read tool when their contents are needed; do not claim to have inspected a file before reading it.";
54
+ const FILE_REFERENCE_PROMPT = "Tokens prefixed with @ are workspace paths the user explicitly referenced, relative to the workspace root. A trailing slash marks a directory: list it when its contents matter. Anything else is a file: use the read tool when its contents are needed, and do not claim to have inspected it before reading. @\"...\" quotes a path containing spaces.";
93
55
  /** Host capability for cancellable file-reference discovery. */
94
- let FileReferenceService = (() => {
95
- let _classSuper = TypertRemoteService;
96
- let _instanceExtraInitializers = [];
97
- let _remoteExportList_decorators;
98
- return class FileReferenceService extends _classSuper {
99
- static {
100
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
101
- _remoteExportList_decorators = [Remote("list")];
102
- __esDecorate(this, null, _remoteExportList_decorators, {
103
- kind: "method",
104
- name: "remoteExportList",
105
- static: false,
106
- private: false,
107
- access: {
108
- has: (obj) => "remoteExportList" in obj,
109
- get: (obj) => obj.remoteExportList
110
- },
111
- metadata: _metadata
112
- }, null, _instanceExtraInitializers);
113
- if (_metadata) Object.defineProperty(this, Symbol.metadata, {
114
- enumerable: true,
115
- configurable: true,
116
- writable: true,
117
- value: _metadata
118
- });
119
- }
120
- constructor(ctx) {
121
- super(ctx, "fileReferences");
122
- __runInitializers(this, _instanceExtraInitializers);
123
- }
124
- /**
125
- * Remote face of {@link list}; the decorator cannot mark the abstract
126
- * member, so this concrete adapter carries the identical contract.
127
- * @param agent - target agent whose session cwd bounds discovery.
128
- * @param query - path text following `@` or `@"`.
129
- * @param signal - caller cancellation.
130
- * @returns deterministic path-only candidates.
131
- */
132
- remoteExportList(agent, query, signal) {
133
- return this.list(agent, query, signal);
134
- }
135
- };
136
- })();
56
+ var FileReferenceService = class extends Service {
57
+ constructor(ctx) {
58
+ super(ctx, "fileReferences");
59
+ }
60
+ };
137
61
  //#endregion
138
62
  export { FILE_REFERENCE_PROMPT, FileReferenceService, FileReferenceService as default, activeAtToken, formatFileMention };
@@ -3,22 +3,21 @@
3
3
  *
4
4
  * @module @deepseek-ai/dsh-file-reference
5
5
  */
6
- import type { Context } from '@deepseek-ai/cordis';
6
+ import { Service, type Context } from '@deepseek-ai/cordis';
7
7
  import type { Agent } from '@deepseek-ai/dsh-agent';
8
- import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
9
8
  import type { FileReferenceCandidate } from './types.ts';
10
9
  export { activeAtToken, formatFileMention } from './grammar.ts';
11
10
  export type { ActiveAtToken } from './grammar.ts';
12
11
  export type { FileReferenceCandidate } from './types.ts';
13
12
  /** Model guidance for path-only references selected by a user interface. */
14
- export declare const FILE_REFERENCE_PROMPT = "Paths prefixed with @ are files explicitly referenced by the user. Use the read tool when their contents are needed; do not claim to have inspected a file before reading it.";
13
+ export declare const FILE_REFERENCE_PROMPT = "Tokens prefixed with @ are workspace paths the user explicitly referenced, relative to the workspace root. A trailing slash marks a directory: list it when its contents matter. Anything else is a file: use the read tool when its contents are needed, and do not claim to have inspected it before reading. @\"...\" quotes a path containing spaces.";
15
14
  declare module '@deepseek-ai/cordis' {
16
15
  interface Context {
17
16
  fileReferences: FileReferenceService;
18
17
  }
19
18
  }
20
19
  /** Host capability for cancellable file-reference discovery. */
21
- export declare abstract class FileReferenceService extends TypertRemoteService {
20
+ export declare abstract class FileReferenceService extends Service {
22
21
  constructor(ctx: Context);
23
22
  /**
24
23
  * List file and directory candidates for one agent's working directory.
@@ -28,15 +27,6 @@ export declare abstract class FileReferenceService extends TypertRemoteService {
28
27
  * @returns deterministic path-only candidates.
29
28
  */
30
29
  abstract list(agent: Agent, query: string, signal: AbortSignal): Promise<FileReferenceCandidate[]>;
31
- /**
32
- * Remote face of {@link list}; the decorator cannot mark the abstract
33
- * member, so this concrete adapter carries the identical contract.
34
- * @param agent - target agent whose session cwd bounds discovery.
35
- * @param query - path text following `@` or `@"`.
36
- * @param signal - caller cancellation.
37
- * @returns deterministic path-only candidates.
38
- */
39
- remoteExportList(agent: Agent, query: string, signal: AbortSignal): Promise<FileReferenceCandidate[]>;
40
30
  }
41
31
  export default FileReferenceService;
42
32
  //# sourceMappingURL=index.d.ts.map
@@ -3,73 +3,15 @@
3
3
  *
4
4
  * @module @deepseek-ai/dsh-file-reference
5
5
  */
6
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
7
- var useValue = arguments.length > 2;
8
- for (var i = 0; i < initializers.length; i++) {
9
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
10
- }
11
- return useValue ? value : void 0;
12
- };
13
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
14
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
15
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
16
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
17
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
18
- var _, done = false;
19
- for (var i = decorators.length - 1; i >= 0; i--) {
20
- var context = {};
21
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
22
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
23
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
24
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
25
- if (kind === "accessor") {
26
- if (result === void 0) continue;
27
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
28
- if (_ = accept(result.get)) descriptor.get = _;
29
- if (_ = accept(result.set)) descriptor.set = _;
30
- if (_ = accept(result.init)) initializers.unshift(_);
31
- }
32
- else if (_ = accept(result)) {
33
- if (kind === "field") initializers.unshift(_);
34
- else descriptor[key] = _;
35
- }
36
- }
37
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
38
- done = true;
39
- };
40
- import { Remote, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
6
+ import { Service } from '@deepseek-ai/cordis';
41
7
  export { activeAtToken, formatFileMention } from "./grammar.js";
42
8
  /** Model guidance for path-only references selected by a user interface. */
43
- export const FILE_REFERENCE_PROMPT = 'Paths prefixed with @ are files explicitly referenced by the user. Use the read tool when their contents are needed; do not claim to have inspected a file before reading it.';
9
+ export const FILE_REFERENCE_PROMPT = 'Tokens prefixed with @ are workspace paths the user explicitly referenced, relative to the workspace root. A trailing slash marks a directory: list it when its contents matter. Anything else is a file: use the read tool when its contents are needed, and do not claim to have inspected it before reading. @"..." quotes a path containing spaces.';
44
10
  /** Host capability for cancellable file-reference discovery. */
45
- let FileReferenceService = (() => {
46
- let _classSuper = TypertRemoteService;
47
- let _instanceExtraInitializers = [];
48
- let _remoteExportList_decorators;
49
- return class FileReferenceService extends _classSuper {
50
- static {
51
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
52
- _remoteExportList_decorators = [Remote('list')];
53
- __esDecorate(this, null, _remoteExportList_decorators, { kind: "method", name: "remoteExportList", static: false, private: false, access: { has: obj => "remoteExportList" in obj, get: obj => obj.remoteExportList }, metadata: _metadata }, null, _instanceExtraInitializers);
54
- if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
55
- }
56
- constructor(ctx) {
57
- super(ctx, 'fileReferences');
58
- __runInitializers(this, _instanceExtraInitializers);
59
- }
60
- /**
61
- * Remote face of {@link list}; the decorator cannot mark the abstract
62
- * member, so this concrete adapter carries the identical contract.
63
- * @param agent - target agent whose session cwd bounds discovery.
64
- * @param query - path text following `@` or `@"`.
65
- * @param signal - caller cancellation.
66
- * @returns deterministic path-only candidates.
67
- */
68
- remoteExportList(agent, query, signal) {
69
- return this.list(agent, query, signal);
70
- }
71
- };
72
- })();
73
- export { FileReferenceService };
11
+ export class FileReferenceService extends Service {
12
+ constructor(ctx) {
13
+ super(ctx, 'fileReferences');
14
+ }
15
+ }
74
16
  export default FileReferenceService;
75
17
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-file-reference",
3
3
  "description": "File-reference discovery contract and shared @file grammar",
4
- "version": "0.1.1-rc.1",
4
+ "version": "0.1.2-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -30,14 +30,6 @@
30
30
  "types": "./lib/types/types.d.ts",
31
31
  "default": "./lib/types/types.js"
32
32
  },
33
- "./typert": {
34
- "types": "./lib/typert.host.d.ts",
35
- "default": "./lib/typert.host.js"
36
- },
37
- "./remote": {
38
- "types": "./lib/typert.remote-client.d.ts",
39
- "default": "./lib/typert.remote-client.js"
40
- },
41
33
  "./src/*": "./src/*",
42
34
  "./package.json": "./package.json"
43
35
  },
@@ -45,26 +37,17 @@
45
37
  "lib/index.js",
46
38
  "lib/invariant.js",
47
39
  "lib/types/**/*.js",
48
- "lib/types/**/*.d.ts",
49
- "lib/typert.host.js",
50
- "lib/typert.host.d.ts",
51
- "lib/typert.remote-client.js",
52
- "lib/typert.remote-client.d.ts"
40
+ "lib/types/**/*.d.ts"
53
41
  ],
54
42
  "license": "MIT",
55
43
  "peerDependencies": {
56
- "@deepseek-ai/dsh-agent": "^0.1.1-rc.1",
57
- "@deepseek-ai/dsh-invariants": "^0.1.1-rc.1",
58
- "@deepseek-ai/dsh-typert-protocol": "^0.1.1-rc.1",
59
- "@deepseek-ai/cordis": "^4.0.1"
44
+ "@deepseek-ai/dsh-agent": "^0.1.2-alpha.2",
45
+ "@deepseek-ai/cordis": "^4.0.2",
46
+ "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2"
60
47
  },
61
48
  "devDependencies": {
62
- "@deepseek-ai/dsh-invariants": "^0.1.1-rc.1",
63
- "@deepseek-ai/dsh-typert-protocol": "^0.1.1-rc.1",
64
- "@deepseek-ai/dsh-agent": "^0.1.1-rc.1",
65
- "@deepseek-ai/cordis": "^4.0.1"
66
- },
67
- "dependencies": {
68
- "zod": "^4.4.3"
49
+ "@deepseek-ai/dsh-agent": "^0.1.2-alpha.2",
50
+ "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
51
+ "@deepseek-ai/cordis": "^4.0.2"
69
52
  }
70
53
  }
@@ -1,3 +0,0 @@
1
- /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
-
3
- export declare const TYPERT: unknown
@@ -1,436 +0,0 @@
1
- /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
- import { z } from 'zod'
3
-
4
- const _deepseek_ai_dsh_file_reference_fileReferences_list_parameter_0$schema = z.intersection(z.string(), z.unknown())
5
- const _deepseek_ai_dsh_file_reference_fileReferences_list_parameter_1$schema = z.string()
6
- const _deepseek_ai_dsh_file_reference_fileReferences_list_result$schema = z.array(z.object({
7
- 'path': z.string(),
8
- 'kind': z.union([z.literal("file"), z.literal("directory")]),
9
- }))
10
-
11
- export const TYPERT = {
12
- package: '@deepseek-ai/dsh-file-reference',
13
- face: 'host',
14
- schemas: [
15
- ],
16
- invocations: [
17
- {
18
- id: '@deepseek-ai/dsh-file-reference#fileReferences/list',
19
- service: 'fileReferences',
20
- namespace: 'fileReferences',
21
- method: 'list',
22
- implementation: 'remoteExportList',
23
- invocation: { kind: 'direct' },
24
- scope: {
25
- context: 'agent',
26
- wire: 'agentId',
27
- },
28
- parameters: [
29
- {
30
- name: 'agent',
31
- wire: 'agentId',
32
- source: 'lookup',
33
- lookup: 'agent',
34
- codec: {
35
- mode: 'strict',
36
- typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
37
- schema: _deepseek_ai_dsh_file_reference_fileReferences_list_parameter_0$schema,
38
- },
39
- },
40
- {
41
- name: 'query',
42
- wire: 'query',
43
- source: 'json',
44
- codec: {
45
- mode: 'strict',
46
- typeSymbol: '@deepseek-ai/dsh-file-reference#fileReferences/list:query',
47
- schema: _deepseek_ai_dsh_file_reference_fileReferences_list_parameter_1$schema,
48
- },
49
- },
50
- ],
51
- cancellation: { parameter: 'signal' },
52
- result: {
53
- mode: 'strict',
54
- typeSymbol: '@deepseek-ai/dsh-file-reference#fileReferences/list:result',
55
- schema: _deepseek_ai_dsh_file_reference_fileReferences_list_result$schema,
56
- },
57
- sourceLocation: {"file":"packages/context/file-reference/src/index.ts","line":54,"column":3},
58
- },
59
- ],
60
- model: {
61
- "services": [
62
- {
63
- "description": "Host capability for cancellable file-reference discovery.",
64
- "summary": "Host capability for cancellable file-reference discovery.",
65
- "tags": [],
66
- "jsDoc": "/** Host capability for cancellable file-reference discovery. */",
67
- "key": "fileReferences",
68
- "exportName": "FileReferenceService",
69
- "members": [
70
- {
71
- "kind": "method",
72
- "name": "list",
73
- "signature": "abstract list( agent: Agent, query: string, signal: AbortSignal, ): Promise<FileReferenceCandidate[]>",
74
- "summary": "List file and directory candidates for one agent's working directory.",
75
- "jsDoc": "/**\n * List file and directory candidates for one agent's working directory.\n * @param agent - target agent whose session cwd bounds discovery.\n * @param query - path text following `@` or `@\"`.\n * @param signal - caller cancellation.\n * @returns deterministic path-only candidates.\n */"
76
- },
77
- {
78
- "kind": "method",
79
- "name": "remoteExportList",
80
- "signature": "@Remote('list') remoteExportList( agent: Agent, query: string, signal: AbortSignal, ): Promise<FileReferenceCandidate[]>",
81
- "summary": "Remote face of {@link list}; the decorator cannot mark the abstract member, so this concrete adapter carries the identical contract.",
82
- "jsDoc": "/**\n * Remote face of {@link list}; the decorator cannot mark the abstract\n * member, so this concrete adapter carries the identical contract.\n * @param agent - target agent whose session cwd bounds discovery.\n * @param query - path text following `@` or `@\"`.\n * @param signal - caller cancellation.\n * @returns deterministic path-only candidates.\n */"
83
- }
84
- ],
85
- "types": [
86
- {
87
- "name": "Agent",
88
- "declaration": "export interface Agent {\n readonly id: SessionId;\n readonly options: AgentOptions;\n readonly session: Session;\n readonly inbox: Inbox;\n readonly status: AgentStatus;\n readonly ctx: Context;\n cancel(cause: AgentCancelCause, options?: CancelOptions): void;\n whenIdle(): Promise<void>;\n runMaintenance<T>(task: (signal: AbortSignal) => Promise<T>): Promise<T>;\n send(message: UserMessage, target: InboxTarget, wakeup: boolean): void;\n followup(message: UserMessage): void;\n steer(message: UserMessage): void;\n inject(message: UserMessage): void;\n}"
89
- },
90
- {
91
- "name": "AgentCancelCause",
92
- "declaration": "export type AgentCancelCause = { readonly kind: 'user'; } | { readonly kind: 'parent'; } | { readonly kind: 'hook'; readonly reason: string; } | { readonly kind: 'disposed'; };"
93
- },
94
- {
95
- "name": "AgentOptions",
96
- "declaration": "export interface AgentOptions {\n provider?: string;\n model?: string;\n maxTokens?: number;\n}"
97
- },
98
- {
99
- "name": "AgentStatus",
100
- "declaration": "export type AgentStatus = 'idle' | 'running';"
101
- },
102
- {
103
- "name": "ApprovalOutcome",
104
- "declaration": "export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable';"
105
- },
106
- {
107
- "name": "ApprovalPolicy",
108
- "declaration": "export type ApprovalPolicy = 'ask' | 'never';"
109
- },
110
- {
111
- "name": "ApprovalRequestId",
112
- "declaration": "export type ApprovalRequestId = Branded<'ApprovalRequestId'>;"
113
- },
114
- {
115
- "name": "AssistantMessage",
116
- "declaration": "export interface AssistantMessage extends Message {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
117
- },
118
- {
119
- "name": "AssistantProvenance",
120
- "declaration": "export interface AssistantProvenance {\n provider: string;\n model: string;\n replayState?: unknown;\n}"
121
- },
122
- {
123
- "name": "AttachmentId",
124
- "declaration": "export type AttachmentId = Branded<'AttachmentId'>;"
125
- },
126
- {
127
- "name": "Branded",
128
- "declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
129
- },
130
- {
131
- "name": "CallId",
132
- "declaration": "export type CallId = Branded<'CallId'>;"
133
- },
134
- {
135
- "name": "CancelOptions",
136
- "declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
137
- },
138
- {
139
- "name": "CodeDispatchEventData",
140
- "declaration": "export interface CodeDispatchEventData extends CodeDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n}"
141
- },
142
- {
143
- "name": "CodeDispatchStartEventData",
144
- "declaration": "export interface CodeDispatchStartEventData {\n rootCallId: CallId;\n parentCallId: CallId;\n subCallId: CallId;\n name: string;\n arguments: unknown;\n}"
145
- },
146
- {
147
- "name": "CommandId",
148
- "declaration": "export type CommandId = Branded<'CommandId'>;"
149
- },
150
- {
151
- "name": "CommandSource",
152
- "declaration": "export type CommandSource = CommandSourceMap[keyof CommandSourceMap];"
153
- },
154
- {
155
- "name": "CommandSourceMap",
156
- "declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
157
- },
158
- {
159
- "name": "CompactionId",
160
- "declaration": "export type CompactionId = Branded<'CompactionId'>;"
161
- },
162
- {
163
- "name": "ContentBlock",
164
- "declaration": "export type ContentBlock = ContentBlockMap[ContentBlockType];"
165
- },
166
- {
167
- "name": "ContentBlockMap",
168
- "declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n 'tool-call': ToolCallBlock;\n 'tool-result': ToolResultBlock;\n}"
169
- },
170
- {
171
- "name": "ContentBlockType",
172
- "declaration": "export type ContentBlockType = keyof ContentBlockMap;"
173
- },
174
- {
175
- "name": "ContextFormed",
176
- "declaration": "export type ContextFormed = { readonly form?: never; } | { readonly form: 'instructions'; } | { readonly form: 'catalog'; } | { readonly form: 'snapshot'; readonly sections: readonly ContextSnapshotSection[]; } | { readonly form: 'notice'; readonly summary: string; } | { readonly form: 'relay'; } | { readonly form: 'recall'; };"
177
- },
178
- {
179
- "name": "ContextSnapshotSection",
180
- "declaration": "export interface ContextSnapshotSection {\n readonly name: string;\n readonly text: string;\n}"
181
- },
182
- {
183
- "name": "EpochHeader",
184
- "declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n system?: string;\n tools?: ToolSchema[];\n}"
185
- },
186
- {
187
- "name": "FileReferenceCandidate",
188
- "declaration": "export interface FileReferenceCandidate {\n path: string;\n kind: 'file' | 'directory';\n}"
189
- },
190
- {
191
- "name": "FinishReason",
192
- "declaration": "export type FinishReason = FinishReasonMap[keyof FinishReasonMap];"
193
- },
194
- {
195
- "name": "FinishReasonMap",
196
- "declaration": "export interface FinishReasonMap {\n stop: { kind: 'stop'; };\n 'tool-calls': { kind: 'tool-calls'; };\n 'max-tokens': { kind: 'max-tokens'; };\n aborted: { kind: 'aborted'; failure: LlmFailure; };\n error: { kind: 'error'; failure: LlmFailure; };\n}"
197
- },
198
- {
199
- "name": "GoalBlockReason",
200
- "declaration": "export interface GoalBlockReason {\n readonly code: string;\n readonly message: string;\n}"
201
- },
202
- {
203
- "name": "GoalChangeMeta",
204
- "declaration": "export type GoalChangeMeta = GoalSnapshotChangeMeta | GoalClearChangeMeta;"
205
- },
206
- {
207
- "name": "GoalClearChangeMeta",
208
- "declaration": "export interface GoalClearChangeMeta {\n readonly kind: 'goal/change';\n readonly version: 1;\n readonly operation: 'clear';\n readonly cleared: GoalRef;\n readonly clearedAt: number;\n}"
209
- },
210
- {
211
- "name": "GoalId",
212
- "declaration": "export type GoalId = Branded<'GoalId'>;"
213
- },
214
- {
215
- "name": "GoalMessageSource",
216
- "declaration": "export interface GoalMessageSource {\n readonly kind: 'goal';\n readonly goalId: GoalId;\n readonly revision: number;\n readonly round: number;\n}"
217
- },
218
- {
219
- "name": "GoalOperation",
220
- "declaration": "export type GoalOperation = 'create' | 'edit' | 'pause' | 'resume' | 'complete' | 'block' | 'clear';"
221
- },
222
- {
223
- "name": "GoalPhase",
224
- "declaration": "export type GoalPhase = 'active' | 'paused' | 'blocked' | 'complete';"
225
- },
226
- {
227
- "name": "GoalRef",
228
- "declaration": "export interface GoalRef {\n readonly id: GoalId;\n readonly revision: number;\n}"
229
- },
230
- {
231
- "name": "GoalSnapshot",
232
- "declaration": "export interface GoalSnapshot extends GoalRef {\n readonly objective: string;\n readonly phase: GoalPhase;\n readonly blockedReason?: GoalBlockReason;\n readonly maxGoalRounds: number;\n}"
233
- },
234
- {
235
- "name": "GoalSnapshotChangeMeta",
236
- "declaration": "export interface GoalSnapshotChangeMeta {\n readonly kind: 'goal/change';\n readonly version: 1;\n readonly operation: Exclude<GoalOperation, 'clear'>;\n readonly goal: GoalSnapshot;\n readonly roundsStarted: number;\n readonly createdAt: number;\n readonly updatedAt: number;\n}"
237
- },
238
- {
239
- "name": "ImageAttachmentRef",
240
- "declaration": "export interface ImageAttachmentRef {\n attachmentId: AttachmentId;\n mediaType: ImageMediaType;\n bytes: number;\n width: number;\n height: number;\n name?: string;\n}"
241
- },
242
- {
243
- "name": "ImageBlock",
244
- "declaration": "export interface ImageBlock {\n type: 'image';\n attachment: ImageAttachmentRef;\n}"
245
- },
246
- {
247
- "name": "ImageMediaType",
248
- "declaration": "export type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';"
249
- },
250
- {
251
- "name": "Inbox",
252
- "declaration": "export class Inbox {\n get nextTurn(): readonly UserMessage[];\n get nextStep(): readonly UserMessage[];\n get hasPending(): boolean;\n clear(): void;\n claim(target: InboxTarget, turn: number): UserMessage[];\n append(target: InboxTarget, message: UserMessage): void;\n prepend(target: InboxTarget, message: UserMessage): void;\n replace(messageId: MessageId, newMessage: UserMessage): boolean;\n remove(messageId: MessageId): boolean;\n splice(target: InboxTarget, start: number, deleteCount: number, inserted: UserMessage[]): UserMessage[];\n}"
253
- },
254
- {
255
- "name": "InboxTarget",
256
- "declaration": "export type InboxTarget = 'next-turn' | 'next-step';"
257
- },
258
- {
259
- "name": "JsonValue",
260
- "declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
261
- },
262
- {
263
- "name": "LlmCallConfig",
264
- "declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
265
- },
266
- {
267
- "name": "LlmCallConfigAdapterDefaults",
268
- "declaration": "export interface LlmCallConfigAdapterDefaults {\n reasoningEffort?: true;\n maxTokens?: true;\n}"
269
- },
270
- {
271
- "name": "LlmFailure",
272
- "declaration": "export interface LlmFailure {\n readonly message: string;\n readonly code: string;\n readonly status?: number;\n readonly providerRetryAfterMs?: number;\n readonly requestId?: ProviderRequestId;\n}"
273
- },
274
- {
275
- "name": "Message",
276
- "declaration": "export interface Message {\n readonly id: MessageId;\n readonly role: 'system' | 'user' | 'assistant';\n readonly content: ContentBlock[];\n readonly source: MessageSource;\n}"
277
- },
278
- {
279
- "name": "MessageId",
280
- "declaration": "export type MessageId = Branded<'MessageId'>;"
281
- },
282
- {
283
- "name": "MessageSource",
284
- "declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
285
- },
286
- {
287
- "name": "MessageSourceMap",
288
- "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n plugin: { kind: 'plugin'; plugin: string; } & ContextFormed;\n model: ModelMessageSource;\n tool: ToolMessageSource;\n goal: GoalMessageSource;\n 'session-reference': SessionReferenceSource;\n}"
289
- },
290
- {
291
- "name": "ModelMessageSource",
292
- "declaration": "export interface ModelMessageSource extends AssistantProvenance {\n kind: 'model';\n}"
293
- },
294
- {
295
- "name": "ProviderRequestId",
296
- "declaration": "export type ProviderRequestId = Branded<'ProviderRequestId'>;"
297
- },
298
- {
299
- "name": "ReasoningBlock",
300
- "declaration": "export interface ReasoningBlock {\n type: 'reasoning';\n text: string;\n}"
301
- },
302
- {
303
- "name": "ReasoningEffortId",
304
- "declaration": "export type ReasoningEffortId = Branded<'ReasoningEffortId'>;"
305
- },
306
- {
307
- "name": "ReplayEnvelope",
308
- "declaration": "export interface ReplayEnvelope {\n response: unknown;\n blocks?: readonly unknown[];\n}"
309
- },
310
- {
311
- "name": "RequestContext",
312
- "declaration": "export interface RequestContext {\n provider: string;\n model: string;\n contextWindow?: number;\n}"
313
- },
314
- {
315
- "name": "RequestHeaderReason",
316
- "declaration": "export type RequestHeaderReason = 'initial' | 'resume' | 'change';"
317
- },
318
- {
319
- "name": "Session",
320
- "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n get id(): SessionId;\n readonly firstLiveSeq: number;\n get events(): readonly SessionEvent[];\n get seq(): number;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
321
- },
322
- {
323
- "name": "SessionEvent",
324
- "declaration": "export type SessionEvent<T extends SessionEventType = SessionEventType> = { [K in SessionEventType]: { type: K; seq: number; time: number; data: SessionEventMap[K]; ignorable?: true; } & (K extends SurfaceEventType ? { sourceEventSeqs?: number[]; surfaceOp?: SurfaceOp; } : object) }[T];"
325
- },
326
- {
327
- "name": "SessionEventMap",
328
- "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'assistant/chunk': { turn: number; step: number; chunk: StreamChunk; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage; interrupted?: true; };\n 'tool/call': { turn: number; step: number; callId: CallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; }; meta?: JsonValue; };\n 'todo/write': { todos: TodoItem[]; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; };\n 'request/context': RequestContext;\n 'session/end-seed': Record<string, never>;\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: number; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: CallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/code-dispatch-start': CodeDispatchStartEventData;\n 'tool/code-dispatch': CodeDispatchEventData;\n 'goal/change': GoalChangeMeta;\n 'session/title': SessionTitleEventData;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: number; end: number; }; shadowedSeqs: number[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: number; end: number; }; shadowedSeqs: number[]; shadowedTokenCount: number; };\n}"
329
- },
330
- {
331
- "name": "SessionEventType",
332
- "declaration": "export type SessionEventType = keyof SessionEventMap;"
333
- },
334
- {
335
- "name": "SessionHeader",
336
- "declaration": "export interface SessionHeader {\n readonly version: number;\n readonly id: SessionId;\n readonly createdAt: number;\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly seedLength?: number;\n readonly origin?: 'subagent';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n}"
337
- },
338
- {
339
- "name": "SessionId",
340
- "declaration": "export type SessionId = Branded<'SessionId'>;"
341
- },
342
- {
343
- "name": "SessionReferenceSource",
344
- "declaration": "export interface SessionReferenceSource {\n kind: 'session-reference';\n form: 'recall';\n version: 1;\n references: { sessionId: string; label: string; capturedThroughSeq: number | null; compacted: boolean; originalMessages: number; retainedMessages: number; omittedMessages: number; omittedBytes: number; truncated: boolean; inputIndex: number; }[];\n}"
345
- },
346
- {
347
- "name": "SessionSurface",
348
- "declaration": "export interface SessionSurface {\n readonly nodes: readonly number[];\n readonly replaceGeneration: number;\n}"
349
- },
350
- {
351
- "name": "SessionTitleEventData",
352
- "declaration": "export interface SessionTitleEventData {\n readonly title: string;\n readonly messageSeqs: number[];\n readonly source: SessionTitleSource;\n}"
353
- },
354
- {
355
- "name": "SessionTitleModelProvenance",
356
- "declaration": "export interface SessionTitleModelProvenance {\n readonly provider: string;\n readonly model: string;\n}"
357
- },
358
- {
359
- "name": "SessionTitleProviderId",
360
- "declaration": "export type SessionTitleProviderId = Branded<'SessionTitleProviderId'>;"
361
- },
362
- {
363
- "name": "SessionTitleSource",
364
- "declaration": "export type SessionTitleSource = { readonly kind: 'fallback'; } | { readonly kind: 'provider'; readonly provider: SessionTitleProviderId; readonly model?: SessionTitleModelProvenance; } | { readonly kind: 'user'; };"
365
- },
366
- {
367
- "name": "StreamChunk",
368
- "declaration": "export type StreamChunk = { type: 'block-start'; index: number; blockType: ContentBlockType; } | { type: 'text-delta'; index: number; text: string; } | { type: 'reasoning-delta'; index: number; text: string; } | { type: 'tool-call-delta'; index: number; id: CallId; name?: string; argumentsDelta: string; } | { type: 'block-end'; index: number; block: ContentBlock; } | { type: 'usage'; usage: TokenUsage; } | { type: 'finish'; reason: FinishReason; replayState?: ReplayEnvelope; };"
369
- },
370
- {
371
- "name": "SurfaceEventType",
372
- "declaration": "export type SurfaceEventType = 'user/message' | 'assistant/message' | 'tool/result';"
373
- },
374
- {
375
- "name": "SurfaceIntent",
376
- "declaration": "export interface SurfaceIntent {\n surfaceOp: SurfaceOp;\n sourceEventSeqs?: number[];\n}"
377
- },
378
- {
379
- "name": "SurfaceOp",
380
- "declaration": "export type SurfaceOp = 'append' | { op: 'replace'; start: number; end: number; };"
381
- },
382
- {
383
- "name": "TextBlock",
384
- "declaration": "export interface TextBlock {\n type: 'text';\n text: string;\n}"
385
- },
386
- {
387
- "name": "TodoItem",
388
- "declaration": "export interface TodoItem {\n content: string;\n status: 'pending' | 'in_progress' | 'completed';\n}"
389
- },
390
- {
391
- "name": "TokenUsage",
392
- "declaration": "export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}"
393
- },
394
- {
395
- "name": "ToolCallBlock",
396
- "declaration": "export interface ToolCallBlock {\n type: 'tool-call';\n id: CallId;\n name: string;\n arguments: string;\n}"
397
- },
398
- {
399
- "name": "ToolMessageSource",
400
- "declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: CallId;\n}"
401
- },
402
- {
403
- "name": "ToolResultBlock",
404
- "declaration": "export interface ToolResultBlock {\n type: 'tool-result';\n toolCallId: CallId;\n content: ContentBlock[];\n isError?: boolean;\n}"
405
- },
406
- {
407
- "name": "ToolResultMessage",
408
- "declaration": "export interface ToolResultMessage extends Message {\n readonly role: 'user';\n readonly content: [ToolResultBlock];\n readonly source: ToolMessageSource;\n}"
409
- },
410
- {
411
- "name": "ToolSchema",
412
- "declaration": "export interface ToolSchema {\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
413
- },
414
- {
415
- "name": "TurnEndCancelCause",
416
- "declaration": "export type TurnEndCancelCause = AgentCancelCause | { readonly kind: 'legacy'; };"
417
- },
418
- {
419
- "name": "TurnEndReason",
420
- "declaration": "export type TurnEndReason = TurnEndReasonMap[keyof TurnEndReasonMap];"
421
- },
422
- {
423
- "name": "TurnEndReasonMap",
424
- "declaration": "export interface TurnEndReasonMap {\n completed: { kind: 'completed'; };\n aborted: { kind: 'aborted'; reason: TurnEndCancelCause; };\n blocked: { kind: 'blocked'; };\n error: { kind: 'error'; error: LlmFailure; };\n 'max-tokens': { kind: 'max-tokens'; };\n interrupted: { kind: 'interrupted'; };\n}"
425
- },
426
- {
427
- "name": "UserMessage",
428
- "declaration": "export interface UserMessage extends Message {\n readonly role: 'user';\n}"
429
- }
430
- ]
431
- }
432
- ],
433
- "events": [],
434
- "objects": []
435
- },
436
- }
@@ -1,26 +0,0 @@
1
- /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
- import type {
3
- RemoteResult,
4
- TypertRemoteContribution,
5
- } from '@deepseek-ai/dsh-typert-protocol'
6
- import type { FileReferenceCandidate } from '@deepseek-ai/dsh-file-reference/types'
7
- import type { SessionId } from '@deepseek-ai/dsh-session/types'
8
-
9
- declare module '@deepseek-ai/dsh-typert-protocol' {
10
- interface TypertRemoteNamespace$66696c655265666572656e636573 {
11
- list: (agentId: SessionId, query: string, signal?: AbortSignal) => Promise<RemoteResult<FileReferenceCandidate[]>>
12
- }
13
- interface TypertRemoteMap {
14
- 'fileReferences/list': (agentId: SessionId, query: string, signal?: AbortSignal) => Promise<RemoteResult<FileReferenceCandidate[]>>
15
- }
16
- interface TypertRemoteNamespaceMap {
17
- 'fileReferences': TypertRemoteNamespace$66696c655265666572656e636573
18
- }
19
- interface TypertRemoteScopeMap {
20
- 'agent:fileReferences/list': (query: string, signal?: AbortSignal) => Promise<RemoteResult<FileReferenceCandidate[]>>
21
- }
22
- }
23
-
24
- export declare const TYPERT_REMOTE: TypertRemoteContribution
25
- export default TYPERT_REMOTE
26
- //# sourceMappingURL=typert.remote-client.d.ts.map
@@ -1,59 +0,0 @@
1
- /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
- import { z } from 'zod'
3
-
4
- const _deepseek_ai_dsh_file_reference_fileReferences_list_parameter_0$schema = z.intersection(z.string(), z.unknown())
5
- const _deepseek_ai_dsh_file_reference_fileReferences_list_parameter_1$schema = z.string()
6
- const _deepseek_ai_dsh_file_reference_fileReferences_list_result$schema = z.array(z.object({
7
- 'path': z.string(),
8
- 'kind': z.union([z.literal("file"), z.literal("directory")]),
9
- }))
10
-
11
- export const TYPERT_REMOTE = {
12
- package: '@deepseek-ai/dsh-file-reference',
13
- descriptors: [
14
- {
15
- id: '@deepseek-ai/dsh-file-reference#fileReferences/list',
16
- service: 'fileReferences',
17
- namespace: 'fileReferences',
18
- method: 'list',
19
- implementation: 'remoteExportList',
20
- invocation: { kind: 'direct' },
21
- scope: {
22
- context: 'agent',
23
- wire: 'agentId',
24
- },
25
- parameters: [
26
- {
27
- name: 'agent',
28
- wire: 'agentId',
29
- source: 'lookup',
30
- lookup: 'agent',
31
- codec: {
32
- mode: 'strict',
33
- typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
34
- schema: _deepseek_ai_dsh_file_reference_fileReferences_list_parameter_0$schema,
35
- },
36
- },
37
- {
38
- name: 'query',
39
- wire: 'query',
40
- source: 'json',
41
- codec: {
42
- mode: 'strict',
43
- typeSymbol: '@deepseek-ai/dsh-file-reference#fileReferences/list:query',
44
- schema: _deepseek_ai_dsh_file_reference_fileReferences_list_parameter_1$schema,
45
- },
46
- },
47
- ],
48
- cancellation: { parameter: 'signal' },
49
- result: {
50
- mode: 'strict',
51
- typeSymbol: '@deepseek-ai/dsh-file-reference#fileReferences/list:result',
52
- schema: _deepseek_ai_dsh_file_reference_fileReferences_list_result$schema,
53
- },
54
- sourceLocation: {"file":"packages/context/file-reference/src/index.ts","line":54,"column":3},
55
- },
56
- ],
57
- }
58
-
59
- export default TYPERT_REMOTE