Merge remote-tracking branch 'origin/master' into fix/sdk-dsh-doc-parity

# Conflicts:
#	packages/bundle/sdk-app/README.i18n.yaml
#	packages/bundle/sdk-app/README.md
#	packages/bundle/sdk-app/README.zh.md
#	scripts/snapshots/python-sdk-single-exe/authoring/model-visible.json
#	scripts/snapshots/python-sdk-single-exe/authoring/win-x64/model-visible.json
This commit is contained in:
sjw1231 committed 2026-11-19 13:03:11 +08:00
commit c19f8fadfe
223 files changed
+4684 -760

No files matched your search

@@ -9,8 +9,8 @@
en: abd0263d14861926
zh: e1736cd08e87f795
/agent-note-shared-time-vocabulary-for-wall-clock-selectors/decision:
en: f1c2b98bf56cdba3
zh: 7e9444f8e73a4834
en: cf4dc376cbdb0e90
zh: 6aea79fb9dfe419d
/agent-note-shared-time-vocabulary-for-wall-clock-selectors/alternatives-considered:
en: 3964f7d653747b55
zh: b50636faea4917ef
@@ -16,7 +16,7 @@ The library answers discriminated results and carries no failure vocabulary. `pa
Schedule consumes it and keeps every domain decision. `canonicalizeTimeZone`, `decodeInstant`, `parseAtInput`, and `futureInstant` remain Schedule entry points with their existing codes and diagnostics; they call the shared parser and map its reason. Pure Cron/RRULE parsing and bounded occurrence searches belong to the library, take explicit reference times, and validate committed targets with `fourDigitYearEpoch`. Schedule owns durable records, the fold and transition authority, injection-resistant framing, daily and weekly date walks, delivery limits, and domain errors. The shared values own no task state, wall clock, or timers.
`dsh-time-context` consumes it too and keeps its stricter policy. `deriveBrowserTimeZoneContext` reads each user-rpc zone through `canonicalizeTimeZone` and refuses an alias whose canonical answer differs from the reported value, so the request boundary still requires an identity another process resolves back to the same name. Time-context owns its three refusals and their messages; the shared entry only answers the canonical name or a reason, and its `unsupported` rejection carries the platform error the library caught, so that refusal keeps its `cause` in both consumers.
`dsh-time-context` consumes it too and keeps its stricter policy. `deriveBrowserTimeZoneContext` reads each reported user-message zone through `canonicalizeTimeZone` and refuses an alias whose canonical answer differs from the reported value, so the request boundary still requires an identity another process resolves back to the same name. Time-context owns its three refusals and their messages; the shared entry only answers the canonical name or a reason, and its `unsupported` rejection carries the platform error the library caught, so that refusal keeps its `cause` in both consumers.
`Duration` holds one span as a single millisecond count, and it is a class rather than a branded number because TypeScript's arithmetic erases a brand: adding two differently branded numbers answers an unbranded `number`, so a brand cannot stop seconds and milliseconds from being mixed, while an instance can. The unit is milliseconds because every producer and consumer in this repository already uses it (`Date.now()`, `SessionEvent.time`, the session log, the client), and because a double holds every millisecond of the whole `Date` range exactly, so no precision is spent on the unit. Instances are frozen, no coercion hook is overridden, and a span is bounded by the exactly representable millisecond range, which is what makes the split exact. The published surface is `fromMilliseconds` and a whole-part `decompose()`, the two entries the migrated consumer calls.
@@ -16,7 +16,7 @@ Status: implemented
Schedule 消费它,并保留全部域内决策。`canonicalizeTimeZone`、`decodeInstant`、`parseAtInput` 与 `futureInstant` 仍是 Schedule 的入口,保留既有错误码与诊断文案;它们调用共享解析器并映射其原因。纯 Cron/RRULE 解析与有界发生时点搜索归本库所有,接收显式参考时间,并通过 `fourDigitYearEpoch` 校验已提交时点。Schedule 拥有持久记录、折叠与状态转移权威、抗注入的框架文本、每日与每周日期遍历、投递限制及领域错误。共享值不拥有任务状态、墙钟或定时器。
`dsh-time-context` 同样消费它,并保留自己更严格的策略。`deriveBrowserTimeZoneContext` 通过 `canonicalizeTimeZone` 读取每条 user-rpc 时区,并拒绝规范答案与所报值不同的别名,因此请求边界仍然要求另一个进程能解析回同一名称。三条拒绝与它们的文案归 time-context 所有;共享入口只回答规范名称或一个原因;被拒绝的结果中只有 `unsupported` 会携带本库捕获到的平台错误,使该拒绝在两个消费方都保留其 `cause`。
`dsh-time-context` 同样消费它,并保留自己更严格的策略。`deriveBrowserTimeZoneContext` 通过 `canonicalizeTimeZone` 读取每条用户消息上报的时区,并拒绝规范答案与所报值不同的别名,因此请求边界仍然要求另一个进程能解析回同一名称。三条拒绝与它们的文案归 time-context 所有;共享入口只回答规范名称或一个原因;被拒绝的结果中只有 `unsupported` 会携带本库捕获到的平台错误,使该拒绝在两个消费方都保留其 `cause`。
`Duration` 以单一毫秒计数保存一段时间;它做成类而不是 branded number,是因为 TypeScript 的算术会抹掉 brand:两个不同品牌的数字相加得到的是无品牌的 `number`,所以 brand 挡不住秒与毫秒的混用,而实例可以。单位选毫秒,是因为本仓库的每个生产者与消费者本来就用它(`Date.now()`、`SessionEvent.time`、Session 日志、客户端),也因为 double 能精确表示 `Date` 全范围内的每一个毫秒,这个单位不消耗任何精度。实例被冻结,不覆盖任何强制转换钩子,且时间段受可精确表示的毫秒范围约束——这正是拆分精确的前提。公开面就是 `fromMilliseconds` 与整数量拆解 `decompose()`,即已迁移消费方所调用的两个入口。
@@ -0,0 +1,19 @@
# Bilingual-pair consistency record for 2026-11-09-sdk-prompt-time-zone.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/feature/2026-11-09-sdk-prompt-time-zone.md
/agent-note-per-prompt-sdk-time-zone:
en: 44d838b330c01b71
zh: 322844db122f305f
/agent-note-per-prompt-sdk-time-zone/problem:
en: 225547dcc5d63b6e
zh: b62fa355a827d662
/agent-note-per-prompt-sdk-time-zone/decision:
en: be0afd0975a15d3a
zh: 91f161bc2f7cd938
/agent-note-per-prompt-sdk-time-zone/alternatives-considered:
en: b67b2d44aeb2dc6b
zh: 69d0356bfe3204a6
/agent-note-per-prompt-sdk-time-zone/consequences:
en: ec0b5f4a68aaa351
zh: 4eb09ed822f456a2
@@ -0,0 +1,35 @@
# Agent Note: Per-prompt SDK time zone
Status: implemented
English | [中文](2026-11-09-sdk-prompt-time-zone.zh.md)
## Problem
Web and Desktop prompts carry the browser zone that the Host canonicalizes and records on that user message, and [time-context](../../../../packages/context/time-context/README.md) tells the model to interpret unqualified dates and times in it. SDK prompts recorded `{ kind: 'user' }`, and time-context read a zone only from a user source that also had a Web `rpcId`. Every SDK request therefore showed `Browser time zone for this request: unavailable.`, and the model asked about dates that a Web user would never be asked about. The SDK protocol had no field through which an embedding application could report its user's zone.
## Decision
The zone stays request-local message source data, as in the [explicit Schedule time-zone decision](../simplification/2026-08-09-explicit-schedule-time-zone.md); the SDK supplies it per prompt.
- `session/prompt` and `session/query` accept an optional `timeZone`. The TypeScript client accepts it in `HarnessClient.prompt()` options and `run()` options; the Python client accepts the `time_zone` keyword in `session_prompt()` and `run()`.
- The SDK server canonicalizes an explicit value with `canonicalClientTimeZone`, the check the Web Host uses. A rejected value fails that request with a `TypeError`, answered as JSON-RPC `-32603` like the server's other parameter errors, before a Session is created or input is routed.
- An omitted value samples `Intl.DateTimeFormat().resolvedOptions().timeZone` when each prompt is accepted. A sampled value that does not canonicalize, such as `+00:00` under `TZ=GMT` or `Etc/Unknown`, records no zone and does not fail the prompt.
- The prompt records the `sdk-user` message source `{ kind: 'user', clientTimeZone? }` without `rpcId`. The `rpcId` identifies a Web submission for prompt acknowledgement and attachment reclamation, which the SDK does not have.
- `reportedBrowserTimeZone` reads a string `clientTimeZone` from any `user` source. Writers canonicalize before commit, and request preparation still refuses a noncanonical value, so the Web path and the model-visible text stay unchanged.
- Native commands record no zone. Web executes slash commands through `commands.execute` without `clientTimeZone`, and SDK `session/query` routes commands to the same handlers, so `/plan <text>` steers a zone-less message on both paths.
## Alternatives considered
**Inject one runtime-wide zone into every request.** A process or configuration zone applied by time-context would also cover in-process children and plugin messages, but it would present a deployment fact as user authority. The time-context fallback display zone already exists and deliberately keeps the `unavailable` policy.
**Write a synthetic `rpcId` on SDK prompts.** This reuses the Web source variant unchanged, but Web clients use `rpcId` to settle submissions and reclaim attachments, so a synthetic identity would claim a Web submission that never existed.
**Fix the zone at `initialize`.** One value per connection saves a field per prompt, but a long-lived runtime can serve users in different zones and a process zone can change, so the value would become stale. A per-prompt value matches the Web browser sample.
## Consequences
- SDK embeddings that pass no zone now report the runtime process zone. In a container this is usually `UTC`, which may differ from the user's zone; the [upgrade guide](../../../../docs/upgrade-guide/v0.2.2-rc.5/sdk-prompt-time-zone/guide.md) tells consumers to pass `timeZone` or `time_zone`, or to set `TZ`.
- SDK subagent children receive prompts without a zone, so they report their own process zone; in-process children see `unavailable`, as on Web.
- A reader that predates the relaxed check ignores an SDK prompt zone; the [persistence record](../../../../docs/persistence-changes/2026-11-09-sdk-prompt-time-zone.md) keeps the format version.
- `packages/sdk/server/tests/time-zone.spec.ts` pins canonical, rejected, sampled, and unusable zones, the `session/query` route, and matching `/plan` sources on the SDK and native command paths. `apps/cli/tests/profiles/sdk/keyless-smoke.e2e.ts` asserts the model-visible line through the shipped `sdk` profile. The SDK snapshot driver sends `timeZone: 'UTC'` and runs with `TZ=UTC`.
@@ -0,0 +1,35 @@
# Agent Note:SDK prompt 逐条上报时区
Status: implemented
[English](2026-11-09-sdk-prompt-time-zone.md) | 中文
## 问题
Web 与 Desktop 的 prompt 携带浏览器时区,Host 规范化后把它记录在该条用户消息上,[time-context](../../../../packages/context/time-context/README.zh.md) 随后让模型按该时区解释未限定时区的日期与时间。SDK prompt 记录的是 `{ kind: 'user' }`,而 time-context 只从同时带有 Web `rpcId` 的 user 来源读取时区。因此每个 SDK 请求都显示 `Browser time zone for this request: unavailable.`,模型会就 Web 用户从不会被追问的日期去询问用户。SDK 协议也没有字段让嵌入方应用上报其用户的时区。
## 决定
时区仍是请求本地的消息来源数据,与[显式定时任务时区决定](../simplification/2026-08-09-explicit-schedule-time-zone.zh.md)一致;SDK 逐条 prompt 提供它。
- `session/prompt` 与 `session/query` 接受可选的 `timeZone`。TypeScript 客户端在 `HarnessClient.prompt()` 选项和 `run()` 选项中接受它;Python 客户端在 `session_prompt()` 和 `run()` 中接受 `time_zone` 关键字参数。
- SDK server 用 Web Host 所用的同一检查 `canonicalClientTimeZone` 规范化显式值。被拒的值让该请求以 `TypeError` 失败,与 server 的其他参数错误一样应答为 JSON-RPC `-32603`,发生在创建 Session 或路由输入之前。
- 省略时,在接受每条 prompt 时采样 `Intl.DateTimeFormat().resolvedOptions().timeZone`。采样值无法规范化时(例如 `TZ=GMT` 下的 `+00:00` 或 `Etc/Unknown`),不记录时区,也不让 prompt 失败。
- prompt 记录不带 `rpcId` 的 `sdk-user` 消息来源 `{ kind: 'user', clientTimeZone? }`。`rpcId` 标识一次 Web 提交,用于 prompt 确认和附件回收,SDK 没有这样的提交。
- `reportedBrowserTimeZone` 从任何 `user` 来源读取字符串 `clientTimeZone`。写入方在提交前规范化,请求准备阶段仍拒绝非规范值,因此 Web 路径和模型可见文本都不变。
- 原生命令不记录时区。Web 通过 `commands.execute` 执行 slash 命令且不带 `clientTimeZone`,SDK `session/query` 把命令路由到同一批 handler,因此两条路径上的 `/plan <text>` 都 steer 一条不带时区的消息。
## 备选方案
**向每个请求注入一个运行时级时区。** 由 time-context 应用的进程或配置时区也能覆盖进程内子 agent 与插件消息,但它会把部署事实当作用户依据呈现。time-context 已有回退显示时区,并且有意保留 `unavailable` 策略。
**在 SDK prompt 上写入合成的 `rpcId`。** 这样可以原样复用 Web 来源变体,但 Web 客户端用 `rpcId` 结算提交并回收附件,合成标识会声称存在一次从未发生的 Web 提交。
**在 `initialize` 时固定时区。** 每个连接一个值可以省去每条 prompt 的字段,但长期运行的运行时可能服务不同时区的用户,进程时区也可能变化,该值会过时。逐条 prompt 的值与 Web 浏览器采样一致。
## 影响
- 不传时区的 SDK 嵌入方现在上报运行时进程时区。容器中通常是 `UTC`,可能与用户时区不同;[升级指南](../../../../docs/upgrade-guide/v0.2.2-rc.5/sdk-prompt-time-zone/guide.zh.md)要求使用方传入 `timeZone` 或 `time_zone`,或设置 `TZ`。
- SDK subagent 子运行时收到的 prompt 不带时区,因此上报自身进程时区;进程内子 agent 与 Web 上一样看到 `unavailable`。
- 早于放宽检查的读取方会忽略 SDK prompt 的时区;[持久化记录](../../../../docs/persistence-changes/2026-11-09-sdk-prompt-time-zone.zh.md)保持格式版本不变。
- `packages/sdk/server/tests/time-zone.spec.ts` 固定规范化、拒绝、采样与不可用时区,`session/query` 路由,以及 SDK 与原生命令路径上一致的 `/plan` 来源。`apps/cli/tests/profiles/sdk/keyless-smoke.e2e.ts` 通过随发行版交付的 `sdk` profile 断言模型可见的那一行。SDK snapshot 驱动发送 `timeZone: 'UTC'` 并在 `TZ=UTC` 下运行。
@@ -9,8 +9,8 @@
en: 4a7e52f6a16dec96
zh: d558db30801355d9
/agent-note-explicit-schedule-time-zone-boundary/decision:
en: 6f233286c95b5294
zh: 5a1f4ba6f5ccbd36
en: ab632daa5d687c77
zh: b406216a5b35e5ac
/agent-note-explicit-schedule-time-zone-boundary/alternatives-considered:
en: 982fe0b8d24a66ce
zh: e6dceee1ce776d21
@@ -18,5 +18,5 @@
en: 56dcb44f09be3713
zh: 59a6814a662458ad
/agent-note-explicit-schedule-time-zone-boundary/consequences:
en: d9358667c58662e4
zh: d536bb0fccd9f0a9
en: 43980cd5ebdf6685
zh: ed3051f8eb45ead4
@@ -12,9 +12,9 @@ Most of that complexity sat outside Schedule. The model already interprets natur
## Decision
The browser zone is request-local source data. The Web client samples `Intl.DateTimeFormat().resolvedOptions().timeZone` for every prompt. The Host accepts an optional `clientTimeZone`, validates and canonicalizes `UTC` or an IANA Area/Location at the RPC boundary, and logs it on that exact `user-rpc` message. Invalid values reject prompt admission. Non-browser clients may omit it.
The browser zone is request-local source data. The Web client samples `Intl.DateTimeFormat().resolvedOptions().timeZone` for every prompt. The Host accepts an optional `clientTimeZone`, validates and canonicalizes `UTC` or an IANA Area/Location at the RPC boundary, and logs it on that exact `user-rpc` message. Invalid values reject prompt admission. Non-browser clients may omit it; SDK prompts report an explicit or sampled process zone on an `sdk-user` source without `rpcId`, as recorded in [per-prompt SDK time zone](../feature/2026-11-09-sdk-prompt-time-zone.md).
Time-context derives unique, mixed, or missing browser facts from original user-rpc messages in the open turn. A unique zone formats the clock and tells the model to interpret otherwise-unqualified dates and times in that zone. Mixed or missing browser-zone records tell the model to ask the user. The configured or process zone is only a display fallback and is never presented as user authority.
Time-context derives unique, mixed, or missing browser facts from original user messages in the open turn that carry `clientTimeZone`. A unique zone formats the clock and tells the model to interpret otherwise-unqualified dates and times in that zone. Mixed or missing browser-zone records tell the model to ask the user. The configured or process zone is only a display fallback and is never presented as user authority.
Schedule accepts no implicit local zone. `at` is either a strict offset-bearing RFC 3339 string or exact `{ date, time, time_zone }`. The structured form requires its zone even when time-context just showed the model a browser zone. Schedule does not import time-context, inspect user-message sources, read a Session header, or produce a confirmation error. Its parser validates the explicit value, rejects daylight-saving gaps, chooses the first instant in overlaps, and stores only canonical UTC `scheduledAt`.
@@ -43,5 +43,5 @@ Source audits reject `SessionHeader.timeZone`, persistence `time_zone` columns,
- Browser-local natural language works without a persisted Session-zone subsystem.
- Schedule has one explicit, independently testable absolute-time boundary.
- Travel and concurrent tabs affect only their own prompts; a turn with mixed browser-zone records asks instead of mutating shared state.
- Non-browser clients remain valid but must provide enough natural-language context or explicit tool arguments.
- Non-browser clients without a reported zone remain valid but must provide enough natural-language context or explicit tool arguments.
- The model may still make an interpretation error; the tool guarantees only that the explicit calendar value is valid and deterministic.
@@ -12,9 +12,9 @@ Status: implemented
## 决策
浏览器时区是请求本地的来源数据。Web client 会为每条提示词采样 `Intl.DateTimeFormat().resolvedOptions().timeZone`。Host 接受可选的 `clientTimeZone`,在 RPC 边界校验并规范化 `UTC` 或 IANA Area/Location,再将其记录在确切的那条 `user-rpc` 消息上。无效值会使提示词准入被拒绝。非浏览器 client 可以省略它。
浏览器时区是请求本地的来源数据。Web client 会为每条提示词采样 `Intl.DateTimeFormat().resolvedOptions().timeZone`。Host 接受可选的 `clientTimeZone`,在 RPC 边界校验并规范化 `UTC` 或 IANA Area/Location,再将其记录在确切的那条 `user-rpc` 消息上。无效值会使提示词准入被拒绝。非浏览器 client 可以省略它;SDK prompt 在不带 `rpcId` 的 `sdk-user` 来源上上报显式或采样的进程时区,见 [SDK prompt 逐条上报时区](../feature/2026-11-09-sdk-prompt-time-zone.zh.md)。
Time-context 从 open turn 中的原始 user-rpc 消息派生唯一、混合或缺失的浏览器事实。唯一时区会用于格式化时钟,并告诉模型把未明确限定时区的日期和时间解释为该时区。浏览器时区记录混合或缺失时,模型会被告知询问用户。配置或进程时区只作为显示 fallback,绝不会被呈现为用户权威。
Time-context 从 open turn 中带 `clientTimeZone` 的原始 user 消息派生唯一、混合或缺失的浏览器事实。唯一时区会用于格式化时钟,并告诉模型把未明确限定时区的日期和时间解释为该时区。浏览器时区记录混合或缺失时,模型会被告知询问用户。配置或进程时区只作为显示 fallback,绝不会被呈现为用户权威。
Schedule 不接受隐式本地时区。`at` 要么是带显式偏移量且严格符合 RFC 3339 的字符串,要么是精确的 `{ date, time, time_zone }`。即使 time-context 刚向模型展示了浏览器时区,结构化形式仍要求自己的时区。Schedule 不导入 time-context、不检查 user message 来源、不读取 Session header,也不产生确认错误。它的 parser 会校验显式值、拒绝夏令时缺口、在重叠时选择第一个时点,并且只存储规范化后的 UTC `scheduledAt`。
@@ -43,5 +43,5 @@ Host 测试固定别名的规范化、可省略行为和进入 Agent(智能体
- 无需持久 Session 时区子系统,浏览器本地自然语言也能工作。
- Schedule 具有一个显式且可独立测试的绝对时间边界。
- 旅行与并发 tab 只影响各自的提示词;浏览器时区记录混合的 turn 会询问用户,而不是改变共享状态。
- 非浏览器 client 仍然有效,但必须提供足够的自然语言上下文或显式工具参数。
- 未上报时区的非浏览器 client 仍然有效,但必须提供足够的自然语言上下文或显式工具参数。
- 模型仍可能产生解释错误;工具只保证显式日历值有效且具有确定性。
+1
View File
@@ -46,6 +46,7 @@ External packages installed for runtime use or embedded in distributed Host or b
| [`@joplin/turndown-plugin-gfm`](https://github.com/laurent22/joplin-turndown-plugin-gfm) | MIT |
| [`@jridgewell/gen-mapping`](https://github.com/jridgewell/sourcemaps) | MIT |
| [`@js-temporal/polyfill`](https://github.com/js-temporal/temporal-polyfill) | ISC |
| [`@larksuite/cli`](https://github.com/larksuite/cli) | MIT |
| [`@lexical/history`](https://github.com/facebook/lexical) | MIT |
| [`@lexical/plain-text`](https://github.com/facebook/lexical) | MIT |
| [`@lexical/text`](https://github.com/facebook/lexical) | MIT |
@@ -486,6 +486,87 @@ describe('Python SDK dsh profile keyless smoke', () => {
}
}, 30_000)
// TZ belongs to the spawned runtime only; GMT makes ICU report "+00:00", which is not a usable zone name.
it.each([
{ tz: 'America/New_York', sampled: 'Browser time zone for this request: America/New_York. Interpret otherwise-unqualified dates and times in this zone.' },
{ tz: 'GMT', sampled: 'Browser time zone for this request: unavailable. Ask the user to clarify otherwise-unqualified dates and times.' },
])('shows the model the reported or sampled prompt time zone (TZ=$tz)', async ({ tz, sampled }) => {
const root = await mkdtemp(join(tmpdir(), 'dsh-sdk-time-zone-'))
onTestFinished(() => rm(root, { recursive: true, force: true }))
const modelRequests: string[] = []
const modelServer = createServer((request, response) => {
let body = ''
request.setEncoding('utf8')
request.on('data', (chunk: string) => { body += chunk })
request.on('end', () => {
modelRequests.push(body)
response.writeHead(200, { 'content-type': 'text/event-stream' })
response.end(messagesResponse({ type: 'text', text: 'done' }, 'end_turn'))
})
})
onTestFinished(() => new Promise<void>((resolve) => { modelServer.close(() => { resolve() }) }))
await new Promise<void>(resolve => modelServer.listen(0, '127.0.0.1', resolve))
const address = modelServer.address()
if (address === null || typeof address === 'string') throw new Error('model server did not bind a TCP port')
const child = execa(launch.command, [...launch.args, '--profile', 'sdk'], {
cwd: repoRoot,
env: {
...launch.env,
DSH_HOME: join(root, '.dsh'),
DSH_TELEMETRY_DISABLED: '1',
DEEPSEEK_API_KEY: 'keyless-smoke-no-call',
DEEPSEEK_BASE_URL: `http://127.0.0.1:${address.port}`,
TZ: tz,
},
timeout: 35_000,
killSignal: 'SIGKILL',
reject: false,
})
onTestFinished(async () => { child.kill('SIGKILL'); await child })
const lines: string[] = []
let stdoutBuffer = ''
let stderr = ''
child.stdout.on('data', (chunk: Buffer) => {
stdoutBuffer += chunk.toString('utf8')
const parts = stdoutBuffer.split('\n')
stdoutBuffer = parts.pop() ?? ''
lines.push(...parts)
})
child.stderr.on('data', (chunk: Buffer) => { stderr += chunk.toString('utf8') })
const send = (id: number, method: string, params?: object) => {
child.stdin.write(`${JSON.stringify({ jsonrpc: '2.0', id, method, params })}\n`)
return waitForLine(lines, value => value.id === id, () => stderr)
}
const promptRequest = async (id: number, sessionId: string, timeZone?: string): Promise<string> => {
const requests = modelRequests.length
expect(await send(id, 'session/prompt', {
sessionId, contentBlocks: [{ type: 'text', text: 'When is noon tomorrow?' }], ...timeZone === undefined ? {} : { timeZone },
})).toHaveProperty('result.messageId')
await waitForLine(lines, (value) => {
const params = value.params as { sessionId?: string; event?: { type?: string } } | undefined
return value.method === 'session.event' && params?.sessionId === sessionId && params.event?.type === 'turn/end'
}, () => stderr)
expect(modelRequests).toHaveLength(requests + 1)
return modelRequests.at(-1)!
}
await send(1, 'initialize', { cwd: root, provider: 'deepseek-official', model: 'deepseek-v4-pro' })
expect(await promptRequest(2, 'explicit', 'US/Eastern')).toContain(
'Browser time zone for this request: America/New_York. Interpret otherwise-unqualified dates and times in this zone.',
)
expect(await promptRequest(3, 'sampled')).toContain(sampled)
expect(await send(4, 'session/prompt', {
sessionId: 'invalid', contentBlocks: [{ type: 'text', text: 'When is noon?' }], timeZone: 'CST',
})).toMatchObject({
error: { code: -32603, message: 'timeZone must be UTC or a valid IANA Area/Location name: "CST"' },
})
expect(modelRequests).toHaveLength(2)
await send(5, 'shutdown')
const exit = await child
expect(exit.exitCode, `signal=${String(exit.signal)}; stderr=${stderr}`).toBe(0)
}, 40_000)
it('rejects an invalid max-token success env value', async () => {
const root = await mkdtemp(join(tmpdir(), 'dsh-python-sdk-runtime-invalid-'))
try {
+144
View File
@@ -0,0 +1,144 @@
// Feishu setup failures and recovery through the real Host/Remote/browser composition.
// A stand-in CLI waits for each authorization page visit and keeps account state on disk.
import { chmod, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
import type { Browser, BrowserContext, Page } from 'playwright'
import { chromium } from 'playwright'
import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest'
import { launchWebScaffold, watchConsole, type WebScaffold } from './scaffold.ts'
import { ZH_BROWSER_LOCALE, saveFailureShot } from './support.ts'
const FEISHU_DIR = fileURLToPath(new URL('../../../packages/connector/feishu', import.meta.url))
const SETUP_URL = 'https://open.feishu.cn/page/cli?e2e=1'
const SETUP_RETRY_URL = `${SETUP_URL}&retry=1`
const SIGN_IN_URL = 'https://accounts.feishu.cn/oauth/device?e2e=1'
// The stand-in keeps its account in state.json beside itself; app setup and
// sign-in wait until the test marks their page visited.
const LARK_CLI = `#!/usr/bin/env node
const { existsSync, readFileSync, writeFileSync } = require('node:fs')
const { join } = require('node:path')
const dir = __dirname
const statePath = join(dir, 'state.json')
const state = existsSync(statePath) ? JSON.parse(readFileSync(statePath, 'utf8')) : { app: false, user: false }
const save = () => { writeFileSync(statePath, JSON.stringify(state)) }
const visited = (name, done) => {
const poll = setInterval(() => {
if (!existsSync(join(dir, name))) return
clearInterval(poll)
done()
}, 50)
}
const line = (value) => { process.stdout.write(JSON.stringify(value) + '\\n') }
switch (process.argv.slice(2).join(' ')) {
case 'auth status --verify --json':
if (!state.app) {
process.stderr.write(JSON.stringify({ ok: false, error: { type: 'config', subtype: 'not_configured' } }))
process.exitCode = 3
} else if (!state.user) line({ appId: 'cli_e2e', identities: { user: { status: 'missing', available: false } } })
else line({ appId: 'cli_e2e', identities: { user: { status: 'ready', available: true, verified: true, userName: '测试用户', openId: 'ou_e2e' } } })
break
case 'config init --new':
process.stderr.write('Open this link to create an app:\\n ' + (existsSync(join(dir, 'setup-fails')) ? '${SETUP_URL}' : '${SETUP_RETRY_URL}') + '\\n')
visited('setup-visited', () => {
if (existsSync(join(dir, 'setup-fails'))) {
process.stderr.write('OK: App configured!\\n' + JSON.stringify({ ok: false, error: {
type: 'internal', subtype: 'sdk_error',
message: 'keychain Set failed: /private/user/appsecret.enc.tmp: operation not permitted; token=fixture-secret',
hint: 'https://open.feishu.cn/page/cli?user_code=fixture-code',
} }, null, 2) + '\\n')
process.exitCode = 5
} else { state.app = true; save() }
})
break
case 'auth login --json':
line({ event: 'device_authorization', verification_uri_complete: '${SIGN_IN_URL}' })
visited('sign-in-visited', () => { state.user = true; save(); line({ event: 'authorization_complete', user_open_id: 'ou_e2e', missing: [] }) })
break
case 'auth logout --json': state.user = false; save(); line({ ok: true }); break
default:
process.stderr.write('unexpected lark-cli arguments: ' + process.argv.slice(2).join(' ') + '\\n')
process.exitCode = 1
}
`
// The stand-in runs through its shebang, which Windows cannot execute.
describe.skipIf(process.platform === 'win32')('web e2e: Feishu plugin connection', () => {
let binDir: string
let scaffold: WebScaffold
let browser: Browser
let context: BrowserContext
let page: Page
let tripwire: ReturnType<typeof watchConsole>
beforeAll(async () => {
binDir = await mkdtemp(join(tmpdir(), 'dsh-feishu-e2e-'))
await writeFile(join(binDir, 'lark-cli'), LARK_CLI)
await chmod(join(binDir, 'lark-cli'), 0o755)
const overlay = join(binDir, 'feishu.overlay.yml')
await writeFile(overlay, `- id: feishu\n config:\n binDir: ${JSON.stringify(binDir)}\n`)
scaffold = await launchWebScaffold({
extraOverlayPath: [fileURLToPath(new URL('./pin-browse-picker.overlay.yml', import.meta.url)), overlay],
profile: { packages: [{ dir: FEISHU_DIR, enabled: true }] },
})
browser = await chromium.launch()
context = await browser.newContext({ viewport: { width: 1680, height: 1000 }, locale: ZH_BROWSER_LOCALE })
for (const [url, marker] of [[SETUP_URL, 'setup-visited'], [SETUP_RETRY_URL, 'setup-visited'], [SIGN_IN_URL, 'sign-in-visited']] as const) {
await context.route(url, async (route) => {
await writeFile(join(binDir, marker), '')
await route.fulfill({ contentType: 'text/html; charset=utf-8', body: '<!doctype html><title>Feishu</title><p>Feishu stand-in page</p>' })
})
}
page = await context.newPage()
tripwire = watchConsole(page)
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
await page.waitForSelector('[class*="frame"]', { timeout: 30_000 })
}, 120_000)
afterAll(async () => {
await browser?.close()
await scaffold?.close()
if (binDir !== undefined) await rm(binDir, { recursive: true, force: true })
})
it('reports failed local setup, then links an existing app, signs in, and signs out', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-feishu-connection'))
await page.getByRole('navigation', { name: '全局面板' }).getByRole('button', { name: '插件', exact: true }).click()
const panel = page.locator('[data-plugin-panel]')
await panel.getByRole('button', { name: '查看 飞书插件', exact: true }).click({ timeout: 20_000 })
const section = panel.locator('[data-connector-account-key="@deepseek-ai/dsh-feishu"]')
await expect.poll(() => section.getAttribute('data-connector-account'), { timeout: 20_000 }).toBe('disconnected')
expect(await panel.locator('[data-plugin-detail]').getByText('未连接', { exact: true }).count()).toBe(2)
const opened: Page[] = []
context.on('page', (popup) => { opened.push(popup) })
await writeFile(join(binDir, 'setup-fails'), '')
await section.getByRole('button', { name: '关联飞书应用', exact: true }).click()
await section.getByRole('alert').waitFor({ timeout: 20_000 })
expect(await section.getAttribute('data-connector-account')).toBe('disconnected')
expect(await section.getByRole('alert').innerText()).toContain('config-init · exit 5')
expect(await section.getByRole('alert').innerText()).toContain('已有应用')
expect(await section.innerText()).not.toContain('fixture-secret')
expect(await section.innerText()).not.toContain('fixture-code')
expect(await section.innerText()).not.toContain('/private/user')
await expect(readFile(join(binDir, 'state.json'), 'utf8')).rejects.toMatchObject({ code: 'ENOENT' })
await rm(join(binDir, 'setup-fails'))
await rm(join(binDir, 'setup-visited'))
await section.getByRole('button', { name: '关联飞书应用', exact: true }).click()
await page.getByText('飞书应用已关联,下一步登录飞书账号', { exact: true }).waitFor({ timeout: 20_000 })
expect(opened.map(popup => popup.url())).toEqual([SETUP_URL, SETUP_RETRY_URL])
await section.getByRole('button', { name: '登录飞书账号', exact: true }).click()
await expect.poll(() => section.getAttribute('data-connector-account'), { timeout: 20_000 }).toBe('connected')
expect(opened.map(popup => popup.url())).toEqual([SETUP_URL, SETUP_RETRY_URL, SIGN_IN_URL])
await section.getByText('已登录为 测试用户。可以在对话中直接请 Agent 使用飞书。', { exact: true }).waitFor({ timeout: 10_000 })
await page.getByText('飞书已连接', { exact: true }).waitFor({ timeout: 10_000 })
await section.getByRole('button', { name: '退出登录', exact: true }).click()
await page.getByRole('dialog', { name: '退出飞书登录?' }).getByRole('button', { name: '退出登录', exact: true }).click()
await expect.poll(() => section.getAttribute('data-connector-account'), { timeout: 20_000 }).toBe('disconnected')
await page.getByText('已退出飞书登录', { exact: true }).waitFor({ timeout: 10_000 })
expect(tripwire.pageErrors).toEqual([])
})
})
+5 -1
View File
@@ -843,7 +843,11 @@ export async function launchWebScaffold(options: LaunchOptions = {}): Promise<We
throw new Error(`web e2e scaffold: the web app requested exit ${String(code)} with no arguments to reject`)
},
})
const resolution = await createRuntimeResolution(resolutionOptions)
// Like the launcher, resolve the dependencies of every selected bundle, not only the extra install anchors.
const selectedLayers = loadProfileDirectory('dsh', profileDir, INSTALL_ANCHOR).layers
const resolution = await createRuntimeResolution({
...resolutionOptions, profile: { ...profile, layers: [...profile.layers, ...selectedLayers] },
})
await ctx.plugin(PluginPackages, {
resolution,
})
+2 -1
View File
@@ -276,7 +276,8 @@
"tests/notion-connection.e2e.ts",
"tests/notion-oauth-fixture.ts",
"tests/tencent-docs-connection.e2e.ts",
"tests/tencent-docs-oauth-fixture.ts"
"tests/tencent-docs-oauth-fixture.ts",
"tests/feishu-connection.e2e.ts"
],
"references": [
{ "path": "../../packages/experimental/auto-review" },
+17
View File
@@ -1668,6 +1668,23 @@ export interface Config {
```
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-experimental-worktree -->
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-feishu -->
<a id="deepseek-aidsh-feishu"></a>
## `@deepseek-ai/dsh-feishu`
- `inject`: `cliAccounts` · `skills`
- `source`: [`packages/connector/feishu/src/index.ts:30`](../packages/connector/feishu/src/index.ts)
```ts config-catalog
/** Where lark-cli is. */
export interface Config {
/** Absolute directory holding the `lark-cli` executable; defaults to the installed `@larksuite/cli` package. */
binDir?: string
}
```
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-feishu -->
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-file-reference-local -->
<a id="deepseek-aidsh-file-reference-local"></a>
+17
View File
@@ -1670,6 +1670,23 @@ export interface Config {
```
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-experimental-worktree -->
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-feishu -->
<a id="deepseek-aidsh-feishu"></a>
## `@deepseek-ai/dsh-feishu`
- `inject`: `cliAccounts` · `skills`
- `source`: [`packages/connector/feishu/src/index.ts:30`](../packages/connector/feishu/src/index.ts)
```ts config-catalog
/** Where lark-cli is. */
export interface Config {
/** Absolute directory holding the `lark-cli` executable; defaults to the installed `@larksuite/cli` package. */
binDir?: string
}
```
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-feishu -->
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-file-reference-local -->
<a id="deepseek-aidsh-file-reference-local"></a>
+1 -1
View File
@@ -109,7 +109,7 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
| `workspace/session-archived` | `parallel` | [`packages/workspace/workspace/src/index.ts:157`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | `worktree` |
| `workspace/session-stop` | `parallel` | [`packages/workspace/workspace/src/index.ts:148`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
| `workspace/session-unarchiving` | `parallel` | [`packages/workspace/workspace/src/index.ts:164`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | `worktree` |
| `worktree/cleanup` | `emit` | [`packages/experimental/worktree/src/archive.ts:26`](../packages/experimental/worktree/src/archive.ts) | `worktree` (`emit`) | - |
| `worktree/cleanup` | `emit` | [`packages/experimental/worktree/src/archive.ts:25`](../packages/experimental/worktree/src/archive.ts) | `worktree` (`emit`) | - |
<!-- END GENERATED event-producer-consumer:events -->
## Non-harness or undeclared event strings seen in package source
+1 -1
View File
@@ -111,7 +111,7 @@
| `workspace/session-archived` | `parallel` | [`packages/workspace/workspace/src/index.ts:157`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | `worktree` |
| `workspace/session-stop` | `parallel` | [`packages/workspace/workspace/src/index.ts:148`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
| `workspace/session-unarchiving` | `parallel` | [`packages/workspace/workspace/src/index.ts:164`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | `worktree` |
| `worktree/cleanup` | `emit` | [`packages/experimental/worktree/src/archive.ts:26`](../packages/experimental/worktree/src/archive.ts) | `worktree` (`emit`) | - |
| `worktree/cleanup` | `emit` | [`packages/experimental/worktree/src/archive.ts:25`](../packages/experimental/worktree/src/archive.ts) | `worktree` (`emit`) | - |
<!-- END GENERATED event-producer-consumer:events -->
## Non-harness or undeclared event strings seen in package source
+6 -1
View File
@@ -244,6 +244,7 @@ flowchart TD
end
subgraph group_connector["packages/connector"]
pkg_cli_account["cli-account"]
pkg_feishu["feishu"]
pkg_linear["linear"]
pkg_notion["notion"]
pkg_tencent_docs["tencent-docs"]
@@ -688,6 +689,8 @@ flowchart TD
pkg_api_workspace_controller --> pkg_storage_domain
pkg_api_workspace_controller --> pkg_typert_protocol
pkg_api_workspace_controller --> pkg_workspace
pkg_feishu --> pkg_cli_account
pkg_feishu --> pkg_skill
pkg_experimental_api_speech_to_text --> pkg_experimental_speech_to_text
pkg_experimental_api_speech_to_text --> pkg_typert_protocol
pkg_experimental_client_ui_cot_translation --> pkg_experimental_translator
@@ -1606,6 +1609,7 @@ flowchart TD
pkg_sdk_jsonrpc_server --> pkg_subagent
pkg_sdk_jsonrpc_server --> pkg_user_approval
pkg_sdk_jsonrpc_server --> pkg_user_questions
pkg_sdk_jsonrpc_server --> pkg_util_time
pkg_sdk_jsonrpc_server --> pkg_working_directory
```
@@ -1847,6 +1851,7 @@ flowchart TD
| [`skill-filesystem`](../packages/skill/skill-filesystem) | `skill` | [`fs`](../packages/fs/fs), [`home-paths`](../packages/util/home-paths), [`skill`](../packages/skill/skill) |
| [`deepseek-auth`](../packages/account/deepseek-auth) | `account` | [`credentials`](../packages/credentials/credentials), [`deepseek-account`](../packages/account/deepseek-account), [`error`](../packages/util/error), [`launch-environment`](../packages/util/launch-environment) |
| [`api-workspace-controller`](../packages/api/workspace-controller) | `api` | [`api-gateway`](../packages/api/gateway), [`client-connection`](../packages/client/connection), [`host-directory-picker`](../packages/host/directory-picker), [`session`](../packages/core/session), [`storage-domain`](../packages/storage/storage-domain), [`typert-protocol`](../packages/typert/protocol), [`workspace`](../packages/workspace/workspace) |
| [`feishu`](../packages/connector/feishu) | `connector` | [`cli-account`](../packages/connector/cli-account), [`skill`](../packages/skill/skill) |
| [`experimental-api-speech-to-text`](../packages/experimental/api-speech-to-text) | `experimental` | [`experimental-speech-to-text`](../packages/experimental/speech-to-text), [`typert-protocol`](../packages/typert/protocol) |
| [`experimental-client-ui-cot-translation`](../packages/experimental/client-ui-cot-translation) | `experimental` | [`experimental-translator`](../packages/experimental/translator) |
| [`experimental-speech-to-text-sensevoice`](../packages/experimental/speech-to-text-sensevoice) | `experimental` | [`experimental-speech-to-text`](../packages/experimental/speech-to-text), [`subprocess`](../packages/subprocess/subprocess) |
@@ -2003,5 +2008,5 @@ flowchart TD
| [`client-test-runtime`](../packages/test-support/client-runtime) | `test-support` | [`api-gateway`](../packages/api/gateway), [`api-session-controller`](../packages/api/session-controller), [`api-workspace-controller`](../packages/api/workspace-controller), [`attachment`](../packages/attachment/attachment), [`client-connection`](../packages/client/connection), [`client-hmr`](../packages/client/hmr), [`client-modules`](../packages/client/modules), [`client-store`](../packages/client/store), [`client-ui-chat`](../packages/client/ui-chat), [`client-ui-context-menu`](../packages/client/ui-context-menu), [`client-ui-conversation`](../packages/client/ui-conversation), [`client-ui-renderer`](../packages/client/ui-renderer), [`client-ui-session`](../packages/client/ui-session), [`client-ui-session-status`](../packages/client/ui-session-status), [`client-ui-settings`](../packages/client/ui-settings), [`client-ui-slots`](../packages/client/ui-slots), [`client-web`](../packages/client/web), [`remote-mock`](../packages/test-support/remote-mock), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`typert-protocol`](../packages/typert/protocol) |
| [`subagent-dsh-sdk`](../packages/subagent/subagent-dsh-sdk) | `subagent` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`sdk-client`](../packages/sdk/client), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`subprocess`](../packages/subprocess/subprocess) |
| [`tool-schedule`](../packages/schedule/tool-schedule) | `schedule` | [`llm`](../packages/llm/llm), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
| [`sdk-jsonrpc-server`](../packages/sdk/server) | `sdk` | [`agent`](../packages/core/agent), [`attachment`](../packages/attachment/attachment), [`commands`](../packages/interaction/commands), [`deepseek-auth`](../packages/account/deepseek-auth), [`goal`](../packages/goal/goal), [`llm`](../packages/llm/llm), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`permission-presets`](../packages/interaction/permission-presets), [`schedule`](../packages/schedule/schedule), [`scope`](../packages/core/scope), [`sdk-protocol`](../packages/sdk/protocol), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`user-approval`](../packages/interaction/user-approval), [`user-questions`](../packages/interaction/user-questions), [`working-directory`](../packages/session/working-directory) |
| [`sdk-jsonrpc-server`](../packages/sdk/server) | `sdk` | [`agent`](../packages/core/agent), [`attachment`](../packages/attachment/attachment), [`commands`](../packages/interaction/commands), [`deepseek-auth`](../packages/account/deepseek-auth), [`goal`](../packages/goal/goal), [`llm`](../packages/llm/llm), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`permission-presets`](../packages/interaction/permission-presets), [`schedule`](../packages/schedule/schedule), [`scope`](../packages/core/scope), [`sdk-protocol`](../packages/sdk/protocol), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`user-approval`](../packages/interaction/user-approval), [`user-questions`](../packages/interaction/user-questions), [`util-time`](../packages/util/time), [`working-directory`](../packages/session/working-directory) |
<!-- END GENERATED module-graph:packages -->
+6 -1
View File
@@ -246,6 +246,7 @@ flowchart TD
end
subgraph group_connector["packages/connector"]
pkg_cli_account["cli-account"]
pkg_feishu["feishu"]
pkg_linear["linear"]
pkg_notion["notion"]
pkg_tencent_docs["tencent-docs"]
@@ -690,6 +691,8 @@ flowchart TD
pkg_api_workspace_controller --> pkg_storage_domain
pkg_api_workspace_controller --> pkg_typert_protocol
pkg_api_workspace_controller --> pkg_workspace
pkg_feishu --> pkg_cli_account
pkg_feishu --> pkg_skill
pkg_experimental_api_speech_to_text --> pkg_experimental_speech_to_text
pkg_experimental_api_speech_to_text --> pkg_typert_protocol
pkg_experimental_client_ui_cot_translation --> pkg_experimental_translator
@@ -1608,6 +1611,7 @@ flowchart TD
pkg_sdk_jsonrpc_server --> pkg_subagent
pkg_sdk_jsonrpc_server --> pkg_user_approval
pkg_sdk_jsonrpc_server --> pkg_user_questions
pkg_sdk_jsonrpc_server --> pkg_util_time
pkg_sdk_jsonrpc_server --> pkg_working_directory
```
@@ -1849,6 +1853,7 @@ flowchart TD
| [`skill-filesystem`](../packages/skill/skill-filesystem) | `skill` | [`fs`](../packages/fs/fs), [`home-paths`](../packages/util/home-paths), [`skill`](../packages/skill/skill) |
| [`deepseek-auth`](../packages/account/deepseek-auth) | `account` | [`credentials`](../packages/credentials/credentials), [`deepseek-account`](../packages/account/deepseek-account), [`error`](../packages/util/error), [`launch-environment`](../packages/util/launch-environment) |
| [`api-workspace-controller`](../packages/api/workspace-controller) | `api` | [`api-gateway`](../packages/api/gateway), [`client-connection`](../packages/client/connection), [`host-directory-picker`](../packages/host/directory-picker), [`session`](../packages/core/session), [`storage-domain`](../packages/storage/storage-domain), [`typert-protocol`](../packages/typert/protocol), [`workspace`](../packages/workspace/workspace) |
| [`feishu`](../packages/connector/feishu) | `connector` | [`cli-account`](../packages/connector/cli-account), [`skill`](../packages/skill/skill) |
| [`experimental-api-speech-to-text`](../packages/experimental/api-speech-to-text) | `experimental` | [`experimental-speech-to-text`](../packages/experimental/speech-to-text), [`typert-protocol`](../packages/typert/protocol) |
| [`experimental-client-ui-cot-translation`](../packages/experimental/client-ui-cot-translation) | `experimental` | [`experimental-translator`](../packages/experimental/translator) |
| [`experimental-speech-to-text-sensevoice`](../packages/experimental/speech-to-text-sensevoice) | `experimental` | [`experimental-speech-to-text`](../packages/experimental/speech-to-text), [`subprocess`](../packages/subprocess/subprocess) |
@@ -2005,5 +2010,5 @@ flowchart TD
| [`client-test-runtime`](../packages/test-support/client-runtime) | `test-support` | [`api-gateway`](../packages/api/gateway), [`api-session-controller`](../packages/api/session-controller), [`api-workspace-controller`](../packages/api/workspace-controller), [`attachment`](../packages/attachment/attachment), [`client-connection`](../packages/client/connection), [`client-hmr`](../packages/client/hmr), [`client-modules`](../packages/client/modules), [`client-store`](../packages/client/store), [`client-ui-chat`](../packages/client/ui-chat), [`client-ui-context-menu`](../packages/client/ui-context-menu), [`client-ui-conversation`](../packages/client/ui-conversation), [`client-ui-renderer`](../packages/client/ui-renderer), [`client-ui-session`](../packages/client/ui-session), [`client-ui-session-status`](../packages/client/ui-session-status), [`client-ui-settings`](../packages/client/ui-settings), [`client-ui-slots`](../packages/client/ui-slots), [`client-web`](../packages/client/web), [`remote-mock`](../packages/test-support/remote-mock), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`typert-protocol`](../packages/typert/protocol) |
| [`subagent-dsh-sdk`](../packages/subagent/subagent-dsh-sdk) | `subagent` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`sdk-client`](../packages/sdk/client), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`subprocess`](../packages/subprocess/subprocess) |
| [`tool-schedule`](../packages/schedule/tool-schedule) | `schedule` | [`llm`](../packages/llm/llm), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
| [`sdk-jsonrpc-server`](../packages/sdk/server) | `sdk` | [`agent`](../packages/core/agent), [`attachment`](../packages/attachment/attachment), [`commands`](../packages/interaction/commands), [`deepseek-auth`](../packages/account/deepseek-auth), [`goal`](../packages/goal/goal), [`llm`](../packages/llm/llm), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`permission-presets`](../packages/interaction/permission-presets), [`schedule`](../packages/schedule/schedule), [`scope`](../packages/core/scope), [`sdk-protocol`](../packages/sdk/protocol), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`user-approval`](../packages/interaction/user-approval), [`user-questions`](../packages/interaction/user-questions), [`working-directory`](../packages/session/working-directory) |
| [`sdk-jsonrpc-server`](../packages/sdk/server) | `sdk` | [`agent`](../packages/core/agent), [`attachment`](../packages/attachment/attachment), [`commands`](../packages/interaction/commands), [`deepseek-auth`](../packages/account/deepseek-auth), [`goal`](../packages/goal/goal), [`llm`](../packages/llm/llm), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`permission-presets`](../packages/interaction/permission-presets), [`schedule`](../packages/schedule/schedule), [`scope`](../packages/core/scope), [`sdk-protocol`](../packages/sdk/protocol), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`user-approval`](../packages/interaction/user-approval), [`user-questions`](../packages/interaction/user-questions), [`util-time`](../packages/util/time), [`working-directory`](../packages/session/working-directory) |
<!-- END GENERATED module-graph:packages -->
+60 -57
View File
@@ -9,8 +9,8 @@
en: 1387c4505dde2faf
zh: 48570fa1c13d6910
/session-persistence-event-catalog/persistence-type-fingerprints:
en: 3de1bc82a91b1fda
zh: e4268205f18b81e8
en: bbdeea7adbc0bf30
zh: ed1eea613a6cb14b
/session-persistence-event-catalog/event-envelope:
en: 5cae0233560db4d6
zh: c8f5efc48be52095
@@ -1038,11 +1038,11 @@
en: a6a2e38fdd6d127a
zh: 1fe82356d89f5769
/session-persistence-event-catalog/resolved-persistence-types/deepseeksearchllmrequest:
en: c2b2df63604aa276
zh: ae73f57f53bb85a0
en: e044fc1cee2eb7d4
zh: efe705bce6fc0ef9
/session-persistence-event-catalog/resolved-persistence-types/developermessage:
en: a3f7241ba795de1e
zh: 084d2dd90601b2b3
en: 116cc4dc07d18606
zh: 3f91cbe2b5fff144
/session-persistence-event-catalog/resolved-persistence-types/epochheader:
en: fa7fd1a765a494e2
zh: fd8e6fdd37d986cf
@@ -1152,11 +1152,11 @@
en: 6dbe099c62f7c226
zh: 6fd788f63c038c91
/session-persistence-event-catalog/resolved-persistence-types/llmretrystartedeventdata:
en: 43a03018774afdb4
zh: 5759aca7d706bf82
en: cf2fa679500b170f
zh: c5ae8545aede2062
/session-persistence-event-catalog/resolved-persistence-types/message:
en: 306e5ce73c068078
zh: ea083b295f6821ad
en: 43a4e4bd1200fc62
zh: 0358110cfec20dd7
/session-persistence-event-catalog/resolved-persistence-types/messagefeedbackdelete:
en: c582953270d4ca44
zh: 966ccfe2e7660a2a
@@ -1167,14 +1167,14 @@
en: f58575a1fc96df42
zh: 9f0c6ed9033e5c9d
/session-persistence-event-catalog/resolved-persistence-types/messagefeedbackrating:
en: d2a0b0ad71c0d335
zh: d11dd6deea395886
en: 8056c68bde26363d
zh: d8cbe789276124b1
/session-persistence-event-catalog/resolved-persistence-types/messagesource:
en: 9521558a9dc6d38d
zh: 8f6f0e1ff972d32c
en: 908ec41c770af7d9
zh: bf07ae6532c9e850
/session-persistence-event-catalog/resolved-persistence-types/message~2:
en: c0e7625fd450e041
zh: 3dcfa3d131de5897
en: 93d183436da8c385
zh: c877886104c2a594
/session-persistence-event-catalog/resolved-persistence-types/modelmessagesource:
en: 65a618e2ec94bbc4
zh: 622197f4b127068b
@@ -1233,11 +1233,11 @@
en: 9a54c4478ad3b620
zh: 02c4c1fd7e252770
/session-persistence-event-catalog/resolved-persistence-types/sessiontitleeventdata:
en: 6cf1e7c94a274a24
zh: 2bce42bf52d0e574
en: cdcdc0620e6d7c49
zh: 3a4e98cb9544c12e
/session-persistence-event-catalog/resolved-persistence-types/sessiontitlellmrequesteventdata:
en: 20ffa8747ad5abab
zh: 836ca9717eafedf3
en: 8a721906148e35c3
zh: 4964b375d0a1bd9f
/session-persistence-event-catalog/resolved-persistence-types/sessiontitlemodelidentity:
en: 7a7245bb23c38655
zh: 6d96a94c367fbe64
@@ -1347,14 +1347,14 @@
en: 73fde4d98617b19f
zh: adae612c15a67764
/session-persistence-event-catalog/resolved-persistence-types/turnendreason:
en: 8b69c6e26f5843ad
zh: 7515d5a3f2419709
en: 883ed71f55d838fd
zh: 6e5251555f9fa362
/session-persistence-event-catalog/resolved-persistence-types/usermessage:
en: da2ff374580fcaa8
zh: b92e64d68122c337
en: 2efbd385157c572a
zh: 8472acc0f626ce58
/session-persistence-event-catalog/resolved-persistence-types/usermessage~2:
en: 6410d8545a391c2b
zh: d9e90b3c5796f76a
en: 7df6a7019dc1adbf
zh: 1f193dc2d0dc672e
/session-persistence-event-catalog/resolved-persistence-types/workflowagentoutcome:
en: 711564ea7898e156
zh: 36b88b84a6dc3c7e
@@ -1485,8 +1485,14 @@
en: 43cf5cd666b591a0
zh: 7c7a3011f8681f12
/session-persistence-event-catalog/resolved-persistence-types/childcreatedat-childid-label-mode~8:
en: a1f188c9058cf621
zh: eb43c0f045fb9afb
en: 514f7ff5d2f88c07
zh: b62cd87601f92642
/session-persistence-event-catalog/resolved-persistence-types/clienttimezone-kind-user:
en: 62beba431162c85e
zh: 2a3aafe663ce31c6
/session-persistence-event-catalog/resolved-persistence-types/clienttimezone-kind-user-principal-rpcid:
en: 90d6159479e5d717
zh: c4dbebd0950e55e9
/session-persistence-event-catalog/resolved-persistence-types/code-name-reason:
en: 7ae42d830651c83c
zh: 1387de7f803d9f08
@@ -1551,11 +1557,11 @@
en: 4cb1c48095df98dc
zh: 5a03e44761af559e
/session-persistence-event-catalog/resolved-persistence-types/header-reason-startsseries:
en: 025df3bb1bbc5369
zh: 52015f4decd2f1e5
en: 747233c059621ae6
zh: c43d942a7feb996f
/session-persistence-event-catalog/resolved-persistence-types/headerseq-message-step-turn:
en: e06f7b64a1665de2
zh: cc2280a56d63cb50
en: 4a0977d6ef222a05
zh: a85ce6839bc04604
/session-persistence-event-catalog/resolved-persistence-types/height-width:
en: a5df50710083ac25
zh: aad3ccf6f6de70e4
@@ -1572,11 +1578,11 @@
en: 41f73c58a77dfa28
zh: af77f4aee3cb4a40
/session-persistence-event-catalog/resolved-persistence-types/inherited:
en: 828241cf325d2bec
zh: f53b66d8e6e8a41c
en: 26b15ad93125db72
zh: 78b407367bbebe52
/session-persistence-event-catalog/resolved-persistence-types/inserted-outcome-removedcount-start:
en: cdd4832101b8d5c1
zh: a98f9c6cb6701d78
en: c43e5f1a961a97c7
zh: 4ab16a990eca92ff
/session-persistence-event-catalog/resolved-persistence-types/interrupted-message-step-stream:
en: 35e45d462a41e963
zh: 89953d22ddada652
@@ -1911,11 +1917,8 @@
en: 08be4349548406a9
zh: 8e7cf9966198ef78
/session-persistence-event-catalog/resolved-persistence-types/kind-tool-registry:
en: 4e102391d685eff5
zh: 9762243a13014f3d
/session-persistence-event-catalog/resolved-persistence-types/kind-user:
en: 156e57c019aa1b28
zh: a1629b267f7cc713
en: 33f81e65eab6b5f4
zh: a909a08515ee73ec
/session-persistence-event-catalog/resolved-persistence-types/kind-user-approval:
en: a52d2dfbaf844127
zh: 4c5306ca40f20873
@@ -2001,11 +2004,11 @@
en: e0d6826170f96136
zh: c684a666de7cee7c
/session-persistence-event-catalog/resolved-persistence-types/type-agent-preset-selected:
en: 3ffd4ea16273b2e2
zh: 0f8cc2f25c129db2
en: 6f4e460cc02ecb54
zh: cbc4655190a0596a
/session-persistence-event-catalog/resolved-persistence-types/type-agent-inbox-spliced:
en: 8595e5be01110031
zh: e53835bbc7208402
en: bfa17b1dd35c840a
zh: 3cd4658024ce7417
/session-persistence-event-catalog/resolved-persistence-types/type-approval-asked:
en: 9c77f18b0dad22f0
zh: 8894cf2878fe90db
@@ -2049,11 +2052,11 @@
en: ba73fb10b7e2ffc9
zh: 8d5c97e63e5f16da
/session-persistence-event-catalog/resolved-persistence-types/type-deliverables-presented:
en: dee59c4cab27840e
zh: d2203a7a79799d1d
en: 9804c72cee421005
zh: 27b031dee4e371c4
/session-persistence-event-catalog/resolved-persistence-types/type-developer-message:
en: 5c0287505cfa913b
zh: 5e783b2e19464855
en: 75fd3954fcf8628d
zh: 69d808b702e90e15
/session-persistence-event-catalog/resolved-persistence-types/type-disabled:
en: 04db8a26a3befdd4
zh: 8b24a37ac00bac8a
@@ -2127,11 +2130,11 @@
en: acf7e21e4d21ebff
zh: fb83a853634d204a
/session-persistence-event-catalog/resolved-persistence-types/type-session-title:
en: d138c51e1202a7f0
zh: 80bc77ae672ad43e
en: 978de727067fd9e1
zh: 6a4c91b2aa5479ad
/session-persistence-event-catalog/resolved-persistence-types/type-session-title-llm-request:
en: 88d1abda906b892d
zh: 010692a91ea0139d
en: aeb2eb7f645f92a0
zh: ecf4aa7d6247628b
/session-persistence-event-catalog/resolved-persistence-types/type-step-end:
en: 7fc233c4a569dae2
zh: bc2b3fed4a397c00
@@ -2211,11 +2214,11 @@
en: 1b045de96172be4b
zh: 8a15c6f35b576b37
/session-persistence-event-catalog/resolved-persistence-types/type-usage:
en: 0ce623d4c59f5a2f
zh: 2d830e6e1badb1ba
en: 7e301e838a718abd
zh: fbf004287370a259
/session-persistence-event-catalog/resolved-persistence-types/type-user-message:
en: 6e4884da342f291a
zh: 454973316ff24910
en: 6a3fdd4c0501be4a
zh: b5ddb6da9843466d
/session-persistence-event-catalog/resolved-persistence-types/type-web-deepseek-search-llm-request:
en: 99c8837344178a47
zh: bf746f5678346596
+73 -59
View File
@@ -23,7 +23,7 @@ The [format references](persistence-changes/historical-formats/README.md) cover
| `JsonlHeaderLine` | header | `18ee62b8900a4c3d046700f05d7a4d49d6cab2a660a020c87481d1603dd8bd4f` | [`HeaderLine`](#persistence-type-sha256-18ee62b8900a4c3d046700f05d7a4d49d6cab2a660a020c87481d1603dd8bd4f) |
| `SessionEventEnvelope` | envelope | `5776e5553ff2dfe3f5bc202dbb1e7c9f93e35a531aebb7764c23b2b6153b2ccc` | [`union (3 variants)`](#persistence-type-sha256-5776e5553ff2dfe3f5bc202dbb1e7c9f93e35a531aebb7764c23b2b6153b2ccc) |
| `event:agent-preset/selected` | event | `a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b` | [`{ type: "agent-preset/selected" }`](#persistence-type-sha256-a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b) |
| `event:agent/inbox/spliced` | event | `f5d843edb0eeef61c9f5328599d5f92b61112b7710b0310b043196b15b390d64` | [`{ type: "agent/inbox/spliced" }`](#persistence-type-sha256-f5d843edb0eeef61c9f5328599d5f92b61112b7710b0310b043196b15b390d64) |
| `event:agent/inbox/spliced` | event | `5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb` | [`{ type: "agent/inbox/spliced" }`](#persistence-type-sha256-5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb) |
| `event:approval/asked` | event | `3bfeb47b58606f4661904bc723da612782214c463d01e6d61cd6d6193d7374e1` | [`{ type: "approval/asked" }`](#persistence-type-sha256-3bfeb47b58606f4661904bc723da612782214c463d01e6d61cd6d6193d7374e1) |
| `event:approval/decided` | event | `bb1ab3d08f49a9f3b265f844cd78d5c49813062a7b34b54904b426f85d0ff6e3` | [`{ type: "approval/decided" }`](#persistence-type-sha256-bb1ab3d08f49a9f3b265f844cd78d5c49813062a7b34b54904b426f85d0ff6e3) |
| `event:approval/policy` | event | `26718e15e7e395bce9642dba5bbe09b3b1a4ce2213d20d566cd9207d7fc5fb78` | [`{ type: "approval/policy" }`](#persistence-type-sha256-26718e15e7e395bce9642dba5bbe09b3b1a4ce2213d20d566cd9207d7fc5fb78) |
@@ -36,7 +36,7 @@ The [format references](persistence-changes/historical-formats/README.md) cover
| `event:compaction/start` | event | `db874d463b0fdec77e9da1c4568f37cb70bd6596781eb93800db44fb8a116965` | [`{ type: "compaction/start" }`](#persistence-type-sha256-db874d463b0fdec77e9da1c4568f37cb70bd6596781eb93800db44fb8a116965) |
| `event:compaction/summary` | event | `e2f9a41e0989f54ed8cee80f8db2bcf9d60a5c810dc9d45b83fa050b9dce7602` | [`{ type: "compaction/summary" }`](#persistence-type-sha256-e2f9a41e0989f54ed8cee80f8db2bcf9d60a5c810dc9d45b83fa050b9dce7602) |
| `event:deliverables/presented` | event | `13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176` | [`{ type: "deliverables/presented" }`](#persistence-type-sha256-13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176) |
| `event:developer/message` | event | `7ee5a828196d9e4b1672f94f977e68f37125da4297c23029dd682823c09e12fd` | [`{ type: "developer/message" }`](#persistence-type-sha256-7ee5a828196d9e4b1672f94f977e68f37125da4297c23029dd682823c09e12fd) |
| `event:developer/message` | event | `53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e` | [`{ type: "developer/message" }`](#persistence-type-sha256-53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e) |
| `event:feedback/message-delete` | event | `3ee93b06f3a125850337602bcdf155d2538c43a5c944ec55b1b3c365152d6796` | [`{ type: "feedback/message-delete" }`](#persistence-type-sha256-3ee93b06f3a125850337602bcdf155d2538c43a5c944ec55b1b3c365152d6796) |
| `event:feedback/message-put` | event | `b5086d249e8502e9ead1d39156bb8d559bde7951cac0f14ce150345b4e42a2bf` | [`{ type: "feedback/message-put" }`](#persistence-type-sha256-b5086d249e8502e9ead1d39156bb8d559bde7951cac0f14ce150345b4e42a2bf) |
| `event:feedback/record` | event | `b54940ff095c17e874c5be03815f4c2145a256cf3a1d34dae4ab2f7769dfffe8` | [`{ type: "feedback/record" }`](#persistence-type-sha256-b54940ff095c17e874c5be03815f4c2145a256cf3a1d34dae4ab2f7769dfffe8) |
@@ -58,7 +58,7 @@ The [format references](persistence-changes/historical-formats/README.md) cover
| `event:session-log-deepseek/delivery-accepted` | event | `d63b8b8ffad9c02fd80c43a17df4f240c1fe8118ecca9de34f9d5871838ab5b9` | [`{ type: "session-log-deepseek/delivery-accepted" }`](#persistence-type-sha256-d63b8b8ffad9c02fd80c43a17df4f240c1fe8118ecca9de34f9d5871838ab5b9) |
| `event:session/end-seed` | event | `5e6db6e24948d4a853c71cb9fabd252ad051ce93d4672c1266cf837c1c17b84e` | [`{ type: "session/end-seed" }`](#persistence-type-sha256-5e6db6e24948d4a853c71cb9fabd252ad051ce93d4672c1266cf837c1c17b84e) |
| `event:session/title` | event | `1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5` | [`{ type: "session/title" }`](#persistence-type-sha256-1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5) |
| `event:session/title-llm-request` | event | `4ee17e4219bd5fab6148ec0a8b3ec0fb939edb8f211374cf779bc8135ef9bed2` | [`{ type: "session/title-llm-request" }`](#persistence-type-sha256-4ee17e4219bd5fab6148ec0a8b3ec0fb939edb8f211374cf779bc8135ef9bed2) |
| `event:session/title-llm-request` | event | `5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260` | [`{ type: "session/title-llm-request" }`](#persistence-type-sha256-5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260) |
| `event:step/end` | event | `e0a787e6ec76c7c94fecbc501b489164ab0293db05bc947914077ad01e674f05` | [`{ type: "step/end" }`](#persistence-type-sha256-e0a787e6ec76c7c94fecbc501b489164ab0293db05bc947914077ad01e674f05) |
| `event:step/start` | event | `4513e088d43e6c68425be30451b9f961cc264fe7318ca62681c41d4d78615986` | [`{ type: "step/start" }`](#persistence-type-sha256-4513e088d43e6c68425be30451b9f961cc264fe7318ca62681c41d4d78615986) |
| `event:subagent/catalog` | event | `d49164d37eab0f0f70fa787c65d887abbea869c010ccb103d717fab3519c3a41` | [`{ type: "subagent/catalog" }`](#persistence-type-sha256-d49164d37eab0f0f70fa787c65d887abbea869c010ccb103d717fab3519c3a41) |
@@ -81,7 +81,7 @@ The [format references](persistence-changes/historical-formats/README.md) cover
| `event:tool/result` | event | `7c9f44e90a0058f4cc532ae20dad0c10afa6eba22e70a6c79fc79490bad64397` | [`{ type: "tool/result" }`](#persistence-type-sha256-7c9f44e90a0058f4cc532ae20dad0c10afa6eba22e70a6c79fc79490bad64397) |
| `event:turn/end` | event | `0f8512903d94f57a4748fa1a2092e64342856796684e6b8343db685b192745ce` | [`{ type: "turn/end" }`](#persistence-type-sha256-0f8512903d94f57a4748fa1a2092e64342856796684e6b8343db685b192745ce) |
| `event:turn/start` | event | `aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8` | [`{ type: "turn/start" }`](#persistence-type-sha256-aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8) |
| `event:user/message` | event | `fb6a6e338625067ac582f55dde412a583040cd738bb8fc6820cb0b941c59f05a` | [`{ type: "user/message" }`](#persistence-type-sha256-fb6a6e338625067ac582f55dde412a583040cd738bb8fc6820cb0b941c59f05a) |
| `event:user/message` | event | `3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a` | [`{ type: "user/message" }`](#persistence-type-sha256-3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a) |
| `event:web/deepseek-search-llm-request` | event | `0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52` | [`{ type: "web/deepseek-search-llm-request" }`](#persistence-type-sha256-0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52) |
| `event:working-directory/change` | event | `124aa62078ca3311353b39cc3bf6c75da281338be6bbf672f8b361d828cddca3` | [`{ type: "working-directory/change" }`](#persistence-type-sha256-124aa62078ca3311353b39cc3bf6c75da281338be6bbf672f8b361d828cddca3) |
| `event:workspace-root/change` | event | `025f11632cd02aaecc23a46c3b5bf43b9009d88293ed9b35ccbc1139d73334dc` | [`{ type: "workspace-root/change" }`](#persistence-type-sha256-025f11632cd02aaecc23a46c3b5bf43b9009d88293ed9b35ccbc1139d73334dc) |
@@ -3464,7 +3464,7 @@ Sources: [`packages/web/web-search-deepseek/src/provider.ts:56`](../packages/web
| `body` | required | [`{ max_tokens, messages, model, thinking?, … }`](#persistence-type-sha256-9c001ecb5e1d3c3894410db2a1e383842e5f8454fb52182338686158abc1b3ee) |
| `endpoint` | required | `string` |
<a id="persistence-type-sha256-010783c095f1d9bddbdd2000f3f0a2d31e2ba4a687f2dabf169c5703b98c9def"></a>
<a id="persistence-type-sha256-3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7"></a>
<a id="persistence-type-developermessage"></a>
@@ -3472,7 +3472,7 @@ Sources: [`packages/web/web-search-deepseek/src/provider.ts:56`](../packages/web
### `DeveloperMessage`
SHA-256: `010783c095f1d9bddbdd2000f3f0a2d31e2ba4a687f2dabf169c5703b98c9def`
SHA-256: `3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7`
Sources: [`packages/llm/llm/src/message.ts:156`](../packages/llm/llm/src/message.ts)
@@ -3481,7 +3481,7 @@ Sources: [`packages/llm/llm/src/message.ts:156`](../packages/llm/llm/src/message
| `content` | required | [`ContentBlock[]`](#persistence-type-sha256-b52f215a6cd691058a3413c12f161fa3b563a2f4895adb3df6f744ec4b0a6ef1) |
| `id` | required | `string` |
| `role` | required | `"developer"` |
| `source` | required | [`MessageSource`](#persistence-type-sha256-394ffa61d7dc84ebfd56ad772b59e47be136b95b9549ebf0b77a3bbebf4ce6cc) |
| `source` | required | [`MessageSource`](#persistence-type-sha256-7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b) |
Source compatibility: `source` — `session-source-attribution` v1; `session.developer-message.source`; `kind`; `preserve`.
@@ -4180,7 +4180,7 @@ Sources: [`packages/llm/llm-retry/src/types.ts:43`](../packages/llm/llm-retry/sr
| `step` | required | `number` |
| `turn` | required | `number` |
<a id="persistence-type-sha256-45e3a4c397121e1a2a455c990b4d45852111b64909ced474d41b9f977ac592a4"></a>
<a id="persistence-type-sha256-d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7"></a>
<a id="persistence-type-message"></a>
@@ -4188,15 +4188,15 @@ Sources: [`packages/llm/llm-retry/src/types.ts:43`](../packages/llm/llm-retry/sr
### `Message`
SHA-256: `45e3a4c397121e1a2a455c990b4d45852111b64909ced474d41b9f977ac592a4`
SHA-256: `d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7`
Sources: [`packages/llm/llm/src/message.ts:195`](../packages/llm/llm/src/message.ts)
One of:
- [`ToolResultMessage`](#persistence-type-sha256-4b259f7f8f0a44ad5e90b70a73553ced1df27012d126921d397ff403b6c86731)
- [`DeveloperMessage`](#persistence-type-sha256-010783c095f1d9bddbdd2000f3f0a2d31e2ba4a687f2dabf169c5703b98c9def)
- [`UserMessage`](#persistence-type-sha256-0aed9f5c80e82b6e80e92eace5b9e23cd5e58c567d37b4321cd147d51342e212)
- [`DeveloperMessage`](#persistence-type-sha256-3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7)
- [`UserMessage`](#persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499)
- [`SystemMessage`](#persistence-type-sha256-09f3f8dc417f278257202714132f98ba7b52957d7b558c4a04456603890eb363)
- [`AssistantMessage`](#persistence-type-sha256-fa87537f4a9c1e25602990a8bf686b383e9e00352ec8946e16ae24ba7c1625be)
@@ -4273,7 +4273,7 @@ One of:
- `"negative"`
- `"positive"`
<a id="persistence-type-sha256-394ffa61d7dc84ebfd56ad772b59e47be136b95b9549ebf0b77a3bbebf4ce6cc"></a>
<a id="persistence-type-sha256-7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b"></a>
<a id="persistence-type-messagesource"></a>
@@ -4281,7 +4281,7 @@ One of:
### `MessageSource`
SHA-256: `394ffa61d7dc84ebfd56ad772b59e47be136b95b9549ebf0b77a3bbebf4ce6cc`
SHA-256: `7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b`
Sources: [`packages/llm/llm/src/message.ts:135`](../packages/llm/llm/src/message.ts)
@@ -4395,8 +4395,9 @@ Sources: [`packages/llm/llm/src/message.ts:135`](../packages/llm/llm/src/message
| `tool-jobs` | `"snapshot"` | `sections`: [`ContextSnapshotSection[]`](#persistence-type-sha256-c748fb42c80a120038a8c587af80ec39924803c401364db11c8974d5bf6d0262) | [`{ kind: "tool-jobs", form: "snapshot" }`](#persistence-type-sha256-c5228b7a55498d84f529591744a0ab26e0b93ade18a70a26db1377a1ecfa6b49) |
| `tool-jobs` | not declared | none | [`{ kind: "tool-jobs" }`](#persistence-type-sha256-24ce31aa528272e59f21cd26da9eca08968bcc97529756a749bfdab71746d9c8) |
| `tool-registry` | not declared | none | [`{ kind: "tool-registry" }`](#persistence-type-sha256-8fcb0b44a575e998665c053643d1ab04c82f39253ebd190ac0c975b78e40b543) |
| `user` | not declared | `rpcId`: `string` | [`{ kind: "user" }`](#persistence-type-sha256-a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302) |
| `user` | not declared | `rpcId`: `string` | [`{ clientTimeZone?, kind: "user", principal?, rpcId }`](#persistence-type-sha256-a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302) |
| `user` | not declared | none | [`CommandSource`](#persistence-type-sha256-ada310bf0bdb8fed51f3b56ea63f6ea6b18bbd587f04fccb63a14ab0b2a24e05) |
| `user` | not declared | none | [`{ clientTimeZone?, kind: "user" }`](#persistence-type-sha256-b8ed92a5ca59733f046ea3506d64c35c64044b6a084fd51daee4c6c72727d39f) |
| `user-approval` | `"catalog"` | none | [`{ kind: "user-approval", form: "catalog" }`](#persistence-type-sha256-825ca23416b1ea9d81442afead5cf9229a6fa05842f042135cc3aa9710a6a2d8) |
| `user-approval` | `"instructions"` | none | [`{ kind: "user-approval", form: "instructions" }`](#persistence-type-sha256-aa2bf9e82b9fdeb94a42af20031fffa30e4e23f01f4ac39757427d4c64c407f0) |
| `user-approval` | `"notice"` | `summary`: `string` | [`{ kind: "user-approval", form: "notice" }`](#persistence-type-sha256-6ccb6bc423fb3952458abf9c1b1c3284208b7e660344b612cc55da773d61afe4) |
@@ -4408,13 +4409,13 @@ Sources: [`packages/llm/llm/src/message.ts:135`](../packages/llm/llm/src/message
| `webhook` | `"notice"` | `deliveryId`: `string`; `provider`: `string`; `ruleId`: `string`; `source`: `string`; `summary`: `string` | [`{ kind: "webhook", form: "notice" }`](#persistence-type-sha256-9edc162949abf93bd5ff049191b345454ba104f583937ce5580fb50f067d2b94) |
| `working-directory` | not declared | none | [`{ kind: "working-directory" }`](#persistence-type-sha256-2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5) |
<a id="persistence-type-sha256-39fe981d6583647fe76f121c43bd6eac1f1a0d6707297f0901b3078899f9ac92"></a>
<a id="persistence-type-sha256-02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a"></a>
### `Message[]`
SHA-256: `39fe981d6583647fe76f121c43bd6eac1f1a0d6707297f0901b3078899f9ac92`
SHA-256: `02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a`
Array of [`Message`](#persistence-type-sha256-45e3a4c397121e1a2a455c990b4d45852111b64909ced474d41b9f977ac592a4).
Array of [`Message`](#persistence-type-sha256-d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7).
<a id="persistence-type-sha256-719c51f67074f97034a6c94297fe1f4b5d3c8d392c57586dab732aa5398c7a91"></a>
@@ -4782,7 +4783,7 @@ Sources: [`packages/session/session-title/src/types.ts:41`](../packages/session/
| `source` | required | [`SessionTitleSource`](#persistence-type-sha256-30d5a537b296685770b1241c4b4bbde19d5a31ff81aa23df73fab5e90b8fc65f) |
| `title` | required | `string` |
<a id="persistence-type-sha256-ee4277d9b4c96ab0a024b3c65d294712b6721808c564162bce7f7feed40c139f"></a>
<a id="persistence-type-sha256-8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69"></a>
<a id="persistence-type-packagessessionsession-title-llmsrcindextssessiontitlellmrequesteventdata"></a>
@@ -4790,7 +4791,7 @@ Sources: [`packages/session/session-title/src/types.ts:41`](../packages/session/
### `SessionTitleLlmRequestEventData`
SHA-256: `ee4277d9b4c96ab0a024b3c65d294712b6721808c564162bce7f7feed40c139f`
SHA-256: `8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69`
Sources: [`packages/session/session-title-llm/src/index.ts:43`](../packages/session/session-title-llm/src/index.ts)
@@ -4798,7 +4799,7 @@ Sources: [`packages/session/session-title-llm/src/index.ts:43`](../packages/sess
|---|---|---|
| `maxTokens` | required | `number` |
| `messageSeqs` | required | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
| `messages` | required | [`Message[]`](#persistence-type-sha256-39fe981d6583647fe76f121c43bd6eac1f1a0d6707297f0901b3078899f9ac92) |
| `messages` | required | [`Message[]`](#persistence-type-sha256-02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a) |
| `reasoningEffort` | optional | `string` |
| `route` | required | [`SessionTitleModelIdentity`](#persistence-type-sha256-07e1a58c58b593f507b8e7f25723bb0aa42baae6e00f5ecfddf28cb1e64d3235) |
| `system` | required | `string` |
@@ -5477,7 +5478,7 @@ Sources: [`packages/core/session/src/types.ts:242`](../packages/core/session/src
| `interrupted` | not declared | none | [`{ kind: "interrupted" }`](#persistence-type-sha256-56b7c047694875a843ba020dfea3c8380d54ae4ff88ab349e72004dc21e07c23) |
| `max-tokens` | not declared | none | [`{ kind: "max-tokens" }`](#persistence-type-sha256-ab7ec5f9eb2c6dfacca5da4c37cf7ba85d04172053ee6b1ebf1709ffcd99c1a7) |
<a id="persistence-type-sha256-0aed9f5c80e82b6e80e92eace5b9e23cd5e58c567d37b4321cd147d51342e212"></a>
<a id="persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499"></a>
<a id="persistence-type-packagesllmllmsrcmessagetsusermessage"></a>
@@ -5485,7 +5486,7 @@ Sources: [`packages/core/session/src/types.ts:242`](../packages/core/session/src
### `UserMessage`
SHA-256: `0aed9f5c80e82b6e80e92eace5b9e23cd5e58c567d37b4321cd147d51342e212`
SHA-256: `120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499`
Sources: [`packages/llm/llm/src/message.ts:161`](../packages/llm/llm/src/message.ts)
@@ -5494,19 +5495,19 @@ Sources: [`packages/llm/llm/src/message.ts:161`](../packages/llm/llm/src/message
| `content` | required | [`ContentBlock[]`](#persistence-type-sha256-b52f215a6cd691058a3413c12f161fa3b563a2f4895adb3df6f744ec4b0a6ef1) |
| `id` | required | `string` |
| `role` | required | `"user"` |
| `source` | required | [`MessageSource`](#persistence-type-sha256-394ffa61d7dc84ebfd56ad772b59e47be136b95b9549ebf0b77a3bbebf4ce6cc) |
| `source` | required | [`MessageSource`](#persistence-type-sha256-7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b) |
Source compatibility: `source` — `session-source-attribution` v1; `session.user-message.source`; `kind`; `preserve`.
Attribution-only additions: `action-cards`, `tmux-context`, `user-question-reply`, `working-directory`.
<a id="persistence-type-sha256-300665af8bcc85dc20a65fd6681ee48d883178731c6f74457ed41539c607bc70"></a>
<a id="persistence-type-sha256-6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85"></a>
### `UserMessage[]`
SHA-256: `300665af8bcc85dc20a65fd6681ee48d883178731c6f74457ed41539c607bc70`
SHA-256: `6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85`
Array of [`UserMessage`](#persistence-type-sha256-0aed9f5c80e82b6e80e92eace5b9e23cd5e58c567d37b4321cd147d51342e212).
Array of [`UserMessage`](#persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499).
<a id="persistence-type-sha256-c2deb7c9183735d4e0fffddf5c623f4e34daa1c8e96b111982e957dfcbbcf896"></a>
@@ -6141,6 +6142,34 @@ SHA-256: `cbbe8377ee744964537dbafd83607219e58ba79a13f6db0d0645c7ad3d5e8a09`
| `mode` | required | `"external"` |
| `version` | required | `2` |
<a id="persistence-type-sha256-b8ed92a5ca59733f046ea3506d64c35c64044b6a084fd51daee4c6c72727d39f"></a>
### `{ clientTimeZone?, kind: "user" }`
SHA-256: `b8ed92a5ca59733f046ea3506d64c35c64044b6a084fd51daee4c6c72727d39f`
Sources: [`packages/sdk/server/src/server.ts:54`](../packages/sdk/server/src/server.ts)
| Property | Presence | Type |
|---|---|---|
| `clientTimeZone` | optional | `string` |
| `kind` | required | `"user"` |
<a id="persistence-type-sha256-a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302"></a>
### `{ clientTimeZone?, kind: "user", principal?, rpcId }`
SHA-256: `a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302`
Sources: [`packages/api/session-controller/src/types.ts:392`](../packages/api/session-controller/src/types.ts)
| Property | Presence | Type |
|---|---|---|
| `clientTimeZone` | optional | `string` |
| `kind` | required | `"user"` |
| `principal` | optional | [`union (2 variants)`](#persistence-type-sha256-824a4aad44a54e245c67196817d67946734a2dc0eee0b0b6834a5b2a6ef352ce) |
| `rpcId` | required | `string` |
<a id="persistence-type-sha256-a81059ca06999da1e712414520c2c65e491d052fcf9640fae20aa38f0a5dc735"></a>
### `{ code, name, reason? }`
@@ -6471,18 +6500,18 @@ Sources: [`packages/core/session/src/types.ts:402`](../packages/core/session/src
| `reason` | required | [`RequestHeaderReason`](#persistence-type-sha256-530da6c0267813bb4511af72883cc518834e624e3b3220a7062955fd57a788a6) |
| `startsSeries` | optional | `true` |
<a id="persistence-type-sha256-129f610271310df606674a5ce5c28b444bbf42c231b0f48ad26a0104ffeb6fde"></a>
<a id="persistence-type-sha256-27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44"></a>
### `{ headerSeq?, message, step, turn }`
SHA-256: `129f610271310df606674a5ce5c28b444bbf42c231b0f48ad26a0104ffeb6fde`
SHA-256: `27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44`
Sources: [`packages/core/session/src/types.ts:321`](../packages/core/session/src/types.ts)
| Property | Presence | Type |
|---|---|---|
| `headerSeq` | optional | `number` |
| `message` | required | [`DeveloperMessage`](#persistence-type-sha256-010783c095f1d9bddbdd2000f3f0a2d31e2ba4a687f2dabf169c5703b98c9def) |
| `message` | required | [`DeveloperMessage`](#persistence-type-sha256-3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7) |
| `step` | required | `number` |
| `turn` | required | `number` |
@@ -6566,17 +6595,17 @@ Sources: [`packages/core/session/src/types.ts:439`](../packages/core/session/src
|---|---|---|
| `inherited` | optional | `true` |
<a id="persistence-type-sha256-261128de68865c1f92f2bfa2ccd21f362d6e624cb00fc0cf5558d9d7b82302c5"></a>
<a id="persistence-type-sha256-d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4"></a>
### `{ inserted, outcome?, removedCount?, start, … }`
SHA-256: `261128de68865c1f92f2bfa2ccd21f362d6e624cb00fc0cf5558d9d7b82302c5`
SHA-256: `d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4`
Sources: [`packages/core/agent/src/types.ts:110`](../packages/core/agent/src/types.ts)
| Property | Presence | Type |
|---|---|---|
| `inserted` | required | [`UserMessage[]`](#persistence-type-sha256-300665af8bcc85dc20a65fd6681ee48d883178731c6f74457ed41539c607bc70) |
| `inserted` | required | [`UserMessage[]`](#persistence-type-sha256-6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85) |
| `outcome` | optional | `"canceled"` |
| `removedCount` | optional | `number` |
| `start` | required | `number` |
@@ -7869,21 +7898,6 @@ Sources: [`packages/core/tools/src/index.ts:28`](../packages/core/tools/src/inde
|---|---|---|
| `kind` | required | `"tool-registry"` |
<a id="persistence-type-sha256-a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302"></a>
### `{ kind: "user" }`
SHA-256: `a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302`
Sources: [`packages/api/session-controller/src/types.ts:392`](../packages/api/session-controller/src/types.ts)
| Property | Presence | Type |
|---|---|---|
| `clientTimeZone` | optional | `string` |
| `kind` | required | `"user"` |
| `principal` | optional | [`union (2 variants)`](#persistence-type-sha256-824a4aad44a54e245c67196817d67946734a2dc0eee0b0b6834a5b2a6ef352ce) |
| `rpcId` | required | `string` |
<a id="persistence-type-sha256-6292bcbedaa97feaec5b48a03bb8144b581b93309d9d6c905f26da7a6a7a0a4f"></a>
### `{ kind: "user-approval" }`
@@ -8264,17 +8278,17 @@ SHA-256: `a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b`
| `time` | required | `number` |
| `type` | required | `"agent-preset/selected"` |
<a id="persistence-type-sha256-f5d843edb0eeef61c9f5328599d5f92b61112b7710b0310b043196b15b390d64"></a>
<a id="persistence-type-sha256-5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb"></a>
<a id="persistence-type-eventagentinboxspliced"></a>
### `{ type: "agent/inbox/spliced" }`
SHA-256: `f5d843edb0eeef61c9f5328599d5f92b61112b7710b0310b043196b15b390d64`
SHA-256: `5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb`
| Property | Presence | Type |
|---|---|---|
| `data` | required | [`{ inserted, outcome?, removedCount?, start, … }`](#persistence-type-sha256-261128de68865c1f92f2bfa2ccd21f362d6e624cb00fc0cf5558d9d7b82302c5) |
| `data` | required | [`{ inserted, outcome?, removedCount?, start, … }`](#persistence-type-sha256-d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4) |
| `ignorable` | optional | `true` |
| `seq` | required | `number` |
| `time` | required | `number` |
@@ -8515,17 +8529,17 @@ SHA-256: `13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176`
| `time` | required | `number` |
| `type` | required | `"deliverables/presented"` |
<a id="persistence-type-sha256-7ee5a828196d9e4b1672f94f977e68f37125da4297c23029dd682823c09e12fd"></a>
<a id="persistence-type-sha256-53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e"></a>
<a id="persistence-type-eventdevelopermessage"></a>
### `{ type: "developer/message" }`
SHA-256: `7ee5a828196d9e4b1672f94f977e68f37125da4297c23029dd682823c09e12fd`
SHA-256: `53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e`
| Property | Presence | Type |
|---|---|---|
| `data` | required | [`{ headerSeq?, message, step, turn }`](#persistence-type-sha256-129f610271310df606674a5ce5c28b444bbf42c231b0f48ad26a0104ffeb6fde) |
| `data` | required | [`{ headerSeq?, message, step, turn }`](#persistence-type-sha256-27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44) |
| `ignorable` | optional | `true` |
| `seq` | required | `number` |
| `sourceEventSeqs` | optional | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
@@ -8925,17 +8939,17 @@ SHA-256: `1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5`
| `time` | required | `number` |
| `type` | required | `"session/title"` |
<a id="persistence-type-sha256-4ee17e4219bd5fab6148ec0a8b3ec0fb939edb8f211374cf779bc8135ef9bed2"></a>
<a id="persistence-type-sha256-5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260"></a>
<a id="persistence-type-eventsessiontitle-llm-request"></a>
### `{ type: "session/title-llm-request" }`
SHA-256: `4ee17e4219bd5fab6148ec0a8b3ec0fb939edb8f211374cf779bc8135ef9bed2`
SHA-256: `5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260`
| Property | Presence | Type |
|---|---|---|
| `data` | required | [`SessionTitleLlmRequestEventData`](#persistence-type-sha256-ee4277d9b4c96ab0a024b3c65d294712b6721808c564162bce7f7feed40c139f) |
| `data` | required | [`SessionTitleLlmRequestEventData`](#persistence-type-sha256-8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69) |
| `ignorable` | optional | `true` |
| `seq` | required | `number` |
| `time` | required | `number` |
@@ -9374,17 +9388,17 @@ Sources: [`packages/llm/llm/src/types.ts:502`](../packages/llm/llm/src/types.ts)
| `type` | required | `"usage"` |
| `usage` | required | [`TokenUsage`](#persistence-type-sha256-fec5442b9ee4122e10514d81d5a43648003fe8bfb7ee2ba50c0cdbdd383ed394) |
<a id="persistence-type-sha256-fb6a6e338625067ac582f55dde412a583040cd738bb8fc6820cb0b941c59f05a"></a>
<a id="persistence-type-sha256-3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a"></a>
<a id="persistence-type-eventusermessage"></a>
### `{ type: "user/message" }`
SHA-256: `fb6a6e338625067ac582f55dde412a583040cd738bb8fc6820cb0b941c59f05a`
SHA-256: `3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a`
| Property | Presence | Type |
|---|---|---|
| `data` | required | [`UserMessage`](#persistence-type-sha256-0aed9f5c80e82b6e80e92eace5b9e23cd5e58c567d37b4321cd147d51342e212) |
| `data` | required | [`UserMessage`](#persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499) |
| `ignorable` | optional | `true` |
| `seq` | required | `number` |
| `sourceEventSeqs` | optional | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
+73 -59
View File
@@ -25,7 +25,7 @@
| `JsonlHeaderLine` | header | `18ee62b8900a4c3d046700f05d7a4d49d6cab2a660a020c87481d1603dd8bd4f` | [`HeaderLine`](#persistence-type-sha256-18ee62b8900a4c3d046700f05d7a4d49d6cab2a660a020c87481d1603dd8bd4f) |
| `SessionEventEnvelope` | envelope | `5776e5553ff2dfe3f5bc202dbb1e7c9f93e35a531aebb7764c23b2b6153b2ccc` | [`union (3 variants)`](#persistence-type-sha256-5776e5553ff2dfe3f5bc202dbb1e7c9f93e35a531aebb7764c23b2b6153b2ccc) |
| `event:agent-preset/selected` | event | `a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b` | [`{ type: "agent-preset/selected" }`](#persistence-type-sha256-a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b) |
| `event:agent/inbox/spliced` | event | `f5d843edb0eeef61c9f5328599d5f92b61112b7710b0310b043196b15b390d64` | [`{ type: "agent/inbox/spliced" }`](#persistence-type-sha256-f5d843edb0eeef61c9f5328599d5f92b61112b7710b0310b043196b15b390d64) |
| `event:agent/inbox/spliced` | event | `5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb` | [`{ type: "agent/inbox/spliced" }`](#persistence-type-sha256-5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb) |
| `event:approval/asked` | event | `3bfeb47b58606f4661904bc723da612782214c463d01e6d61cd6d6193d7374e1` | [`{ type: "approval/asked" }`](#persistence-type-sha256-3bfeb47b58606f4661904bc723da612782214c463d01e6d61cd6d6193d7374e1) |
| `event:approval/decided` | event | `bb1ab3d08f49a9f3b265f844cd78d5c49813062a7b34b54904b426f85d0ff6e3` | [`{ type: "approval/decided" }`](#persistence-type-sha256-bb1ab3d08f49a9f3b265f844cd78d5c49813062a7b34b54904b426f85d0ff6e3) |
| `event:approval/policy` | event | `26718e15e7e395bce9642dba5bbe09b3b1a4ce2213d20d566cd9207d7fc5fb78` | [`{ type: "approval/policy" }`](#persistence-type-sha256-26718e15e7e395bce9642dba5bbe09b3b1a4ce2213d20d566cd9207d7fc5fb78) |
@@ -38,7 +38,7 @@
| `event:compaction/start` | event | `db874d463b0fdec77e9da1c4568f37cb70bd6596781eb93800db44fb8a116965` | [`{ type: "compaction/start" }`](#persistence-type-sha256-db874d463b0fdec77e9da1c4568f37cb70bd6596781eb93800db44fb8a116965) |
| `event:compaction/summary` | event | `e2f9a41e0989f54ed8cee80f8db2bcf9d60a5c810dc9d45b83fa050b9dce7602` | [`{ type: "compaction/summary" }`](#persistence-type-sha256-e2f9a41e0989f54ed8cee80f8db2bcf9d60a5c810dc9d45b83fa050b9dce7602) |
| `event:deliverables/presented` | event | `13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176` | [`{ type: "deliverables/presented" }`](#persistence-type-sha256-13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176) |
| `event:developer/message` | event | `7ee5a828196d9e4b1672f94f977e68f37125da4297c23029dd682823c09e12fd` | [`{ type: "developer/message" }`](#persistence-type-sha256-7ee5a828196d9e4b1672f94f977e68f37125da4297c23029dd682823c09e12fd) |
| `event:developer/message` | event | `53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e` | [`{ type: "developer/message" }`](#persistence-type-sha256-53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e) |
| `event:feedback/message-delete` | event | `3ee93b06f3a125850337602bcdf155d2538c43a5c944ec55b1b3c365152d6796` | [`{ type: "feedback/message-delete" }`](#persistence-type-sha256-3ee93b06f3a125850337602bcdf155d2538c43a5c944ec55b1b3c365152d6796) |
| `event:feedback/message-put` | event | `b5086d249e8502e9ead1d39156bb8d559bde7951cac0f14ce150345b4e42a2bf` | [`{ type: "feedback/message-put" }`](#persistence-type-sha256-b5086d249e8502e9ead1d39156bb8d559bde7951cac0f14ce150345b4e42a2bf) |
| `event:feedback/record` | event | `b54940ff095c17e874c5be03815f4c2145a256cf3a1d34dae4ab2f7769dfffe8` | [`{ type: "feedback/record" }`](#persistence-type-sha256-b54940ff095c17e874c5be03815f4c2145a256cf3a1d34dae4ab2f7769dfffe8) |
@@ -60,7 +60,7 @@
| `event:session-log-deepseek/delivery-accepted` | event | `d63b8b8ffad9c02fd80c43a17df4f240c1fe8118ecca9de34f9d5871838ab5b9` | [`{ type: "session-log-deepseek/delivery-accepted" }`](#persistence-type-sha256-d63b8b8ffad9c02fd80c43a17df4f240c1fe8118ecca9de34f9d5871838ab5b9) |
| `event:session/end-seed` | event | `5e6db6e24948d4a853c71cb9fabd252ad051ce93d4672c1266cf837c1c17b84e` | [`{ type: "session/end-seed" }`](#persistence-type-sha256-5e6db6e24948d4a853c71cb9fabd252ad051ce93d4672c1266cf837c1c17b84e) |
| `event:session/title` | event | `1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5` | [`{ type: "session/title" }`](#persistence-type-sha256-1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5) |
| `event:session/title-llm-request` | event | `4ee17e4219bd5fab6148ec0a8b3ec0fb939edb8f211374cf779bc8135ef9bed2` | [`{ type: "session/title-llm-request" }`](#persistence-type-sha256-4ee17e4219bd5fab6148ec0a8b3ec0fb939edb8f211374cf779bc8135ef9bed2) |
| `event:session/title-llm-request` | event | `5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260` | [`{ type: "session/title-llm-request" }`](#persistence-type-sha256-5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260) |
| `event:step/end` | event | `e0a787e6ec76c7c94fecbc501b489164ab0293db05bc947914077ad01e674f05` | [`{ type: "step/end" }`](#persistence-type-sha256-e0a787e6ec76c7c94fecbc501b489164ab0293db05bc947914077ad01e674f05) |
| `event:step/start` | event | `4513e088d43e6c68425be30451b9f961cc264fe7318ca62681c41d4d78615986` | [`{ type: "step/start" }`](#persistence-type-sha256-4513e088d43e6c68425be30451b9f961cc264fe7318ca62681c41d4d78615986) |
| `event:subagent/catalog` | event | `d49164d37eab0f0f70fa787c65d887abbea869c010ccb103d717fab3519c3a41` | [`{ type: "subagent/catalog" }`](#persistence-type-sha256-d49164d37eab0f0f70fa787c65d887abbea869c010ccb103d717fab3519c3a41) |
@@ -83,7 +83,7 @@
| `event:tool/result` | event | `7c9f44e90a0058f4cc532ae20dad0c10afa6eba22e70a6c79fc79490bad64397` | [`{ type: "tool/result" }`](#persistence-type-sha256-7c9f44e90a0058f4cc532ae20dad0c10afa6eba22e70a6c79fc79490bad64397) |
| `event:turn/end` | event | `0f8512903d94f57a4748fa1a2092e64342856796684e6b8343db685b192745ce` | [`{ type: "turn/end" }`](#persistence-type-sha256-0f8512903d94f57a4748fa1a2092e64342856796684e6b8343db685b192745ce) |
| `event:turn/start` | event | `aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8` | [`{ type: "turn/start" }`](#persistence-type-sha256-aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8) |
| `event:user/message` | event | `fb6a6e338625067ac582f55dde412a583040cd738bb8fc6820cb0b941c59f05a` | [`{ type: "user/message" }`](#persistence-type-sha256-fb6a6e338625067ac582f55dde412a583040cd738bb8fc6820cb0b941c59f05a) |
| `event:user/message` | event | `3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a` | [`{ type: "user/message" }`](#persistence-type-sha256-3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a) |
| `event:web/deepseek-search-llm-request` | event | `0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52` | [`{ type: "web/deepseek-search-llm-request" }`](#persistence-type-sha256-0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52) |
| `event:working-directory/change` | event | `124aa62078ca3311353b39cc3bf6c75da281338be6bbf672f8b361d828cddca3` | [`{ type: "working-directory/change" }`](#persistence-type-sha256-124aa62078ca3311353b39cc3bf6c75da281338be6bbf672f8b361d828cddca3) |
| `event:workspace-root/change` | event | `025f11632cd02aaecc23a46c3b5bf43b9009d88293ed9b35ccbc1139d73334dc` | [`{ type: "workspace-root/change" }`](#persistence-type-sha256-025f11632cd02aaecc23a46c3b5bf43b9009d88293ed9b35ccbc1139d73334dc) |
@@ -3466,7 +3466,7 @@ SHA-256: `abd6ca62a5ab166553848324a23fef90eed7f59c8021bd63e7ea5bc6fd666b0c`
| `body` | 必需 | [`{ max_tokens, messages, model, thinking?, … }`](#persistence-type-sha256-9c001ecb5e1d3c3894410db2a1e383842e5f8454fb52182338686158abc1b3ee) |
| `endpoint` | 必需 | `string` |
<a id="persistence-type-sha256-010783c095f1d9bddbdd2000f3f0a2d31e2ba4a687f2dabf169c5703b98c9def"></a>
<a id="persistence-type-sha256-3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7"></a>
<a id="persistence-type-developermessage"></a>
@@ -3474,7 +3474,7 @@ SHA-256: `abd6ca62a5ab166553848324a23fef90eed7f59c8021bd63e7ea5bc6fd666b0c`
### `DeveloperMessage`
SHA-256: `010783c095f1d9bddbdd2000f3f0a2d31e2ba4a687f2dabf169c5703b98c9def`
SHA-256: `3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7`
来源:[`packages/llm/llm/src/message.ts:156`](../packages/llm/llm/src/message.ts)
@@ -3483,7 +3483,7 @@ SHA-256: `010783c095f1d9bddbdd2000f3f0a2d31e2ba4a687f2dabf169c5703b98c9def`
| `content` | 必需 | [`ContentBlock[]`](#persistence-type-sha256-b52f215a6cd691058a3413c12f161fa3b563a2f4895adb3df6f744ec4b0a6ef1) |
| `id` | 必需 | `string` |
| `role` | 必需 | `"developer"` |
| `source` | 必需 | [`MessageSource`](#persistence-type-sha256-394ffa61d7dc84ebfd56ad772b59e47be136b95b9549ebf0b77a3bbebf4ce6cc) |
| `source` | 必需 | [`MessageSource`](#persistence-type-sha256-7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b) |
消息源兼容策略:`source` — `session-source-attribution` v1; `session.developer-message.source`; `kind`; `preserve`.
@@ -4182,7 +4182,7 @@ SHA-256: `6f72ece8f317cd080c4f20a93f1bf709965f5b81ac4669528f5a023191cfcf20`
| `step` | 必需 | `number` |
| `turn` | 必需 | `number` |
<a id="persistence-type-sha256-45e3a4c397121e1a2a455c990b4d45852111b64909ced474d41b9f977ac592a4"></a>
<a id="persistence-type-sha256-d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7"></a>
<a id="persistence-type-message"></a>
@@ -4190,15 +4190,15 @@ SHA-256: `6f72ece8f317cd080c4f20a93f1bf709965f5b81ac4669528f5a023191cfcf20`
### `Message`
SHA-256: `45e3a4c397121e1a2a455c990b4d45852111b64909ced474d41b9f977ac592a4`
SHA-256: `d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7`
来源:[`packages/llm/llm/src/message.ts:195`](../packages/llm/llm/src/message.ts)
以下类型之一:
- [`ToolResultMessage`](#persistence-type-sha256-4b259f7f8f0a44ad5e90b70a73553ced1df27012d126921d397ff403b6c86731)
- [`DeveloperMessage`](#persistence-type-sha256-010783c095f1d9bddbdd2000f3f0a2d31e2ba4a687f2dabf169c5703b98c9def)
- [`UserMessage`](#persistence-type-sha256-0aed9f5c80e82b6e80e92eace5b9e23cd5e58c567d37b4321cd147d51342e212)
- [`DeveloperMessage`](#persistence-type-sha256-3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7)
- [`UserMessage`](#persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499)
- [`SystemMessage`](#persistence-type-sha256-09f3f8dc417f278257202714132f98ba7b52957d7b558c4a04456603890eb363)
- [`AssistantMessage`](#persistence-type-sha256-fa87537f4a9c1e25602990a8bf686b383e9e00352ec8946e16ae24ba7c1625be)
@@ -4275,7 +4275,7 @@ SHA-256: `390eed1028aba02774f14408647acec10ec5516e97d4f15ecde2b9989d5a69f2`
- `"negative"`
- `"positive"`
<a id="persistence-type-sha256-394ffa61d7dc84ebfd56ad772b59e47be136b95b9549ebf0b77a3bbebf4ce6cc"></a>
<a id="persistence-type-sha256-7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b"></a>
<a id="persistence-type-messagesource"></a>
@@ -4283,7 +4283,7 @@ SHA-256: `390eed1028aba02774f14408647acec10ec5516e97d4f15ecde2b9989d5a69f2`
### `MessageSource`
SHA-256: `394ffa61d7dc84ebfd56ad772b59e47be136b95b9549ebf0b77a3bbebf4ce6cc`
SHA-256: `7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b`
来源:[`packages/llm/llm/src/message.ts:135`](../packages/llm/llm/src/message.ts)
@@ -4397,8 +4397,9 @@ SHA-256: `394ffa61d7dc84ebfd56ad772b59e47be136b95b9549ebf0b77a3bbebf4ce6cc`
| `tool-jobs` | `"snapshot"` | `sections`: [`ContextSnapshotSection[]`](#persistence-type-sha256-c748fb42c80a120038a8c587af80ec39924803c401364db11c8974d5bf6d0262) | [`{ kind: "tool-jobs", form: "snapshot" }`](#persistence-type-sha256-c5228b7a55498d84f529591744a0ab26e0b93ade18a70a26db1377a1ecfa6b49) |
| `tool-jobs` | 未声明 | 无 | [`{ kind: "tool-jobs" }`](#persistence-type-sha256-24ce31aa528272e59f21cd26da9eca08968bcc97529756a749bfdab71746d9c8) |
| `tool-registry` | 未声明 | 无 | [`{ kind: "tool-registry" }`](#persistence-type-sha256-8fcb0b44a575e998665c053643d1ab04c82f39253ebd190ac0c975b78e40b543) |
| `user` | 未声明 | `rpcId`: `string` | [`{ kind: "user" }`](#persistence-type-sha256-a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302) |
| `user` | 未声明 | `rpcId`: `string` | [`{ clientTimeZone?, kind: "user", principal?, rpcId }`](#persistence-type-sha256-a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302) |
| `user` | 未声明 | 无 | [`CommandSource`](#persistence-type-sha256-ada310bf0bdb8fed51f3b56ea63f6ea6b18bbd587f04fccb63a14ab0b2a24e05) |
| `user` | 未声明 | 无 | [`{ clientTimeZone?, kind: "user" }`](#persistence-type-sha256-b8ed92a5ca59733f046ea3506d64c35c64044b6a084fd51daee4c6c72727d39f) |
| `user-approval` | `"catalog"` | 无 | [`{ kind: "user-approval", form: "catalog" }`](#persistence-type-sha256-825ca23416b1ea9d81442afead5cf9229a6fa05842f042135cc3aa9710a6a2d8) |
| `user-approval` | `"instructions"` | 无 | [`{ kind: "user-approval", form: "instructions" }`](#persistence-type-sha256-aa2bf9e82b9fdeb94a42af20031fffa30e4e23f01f4ac39757427d4c64c407f0) |
| `user-approval` | `"notice"` | `summary`: `string` | [`{ kind: "user-approval", form: "notice" }`](#persistence-type-sha256-6ccb6bc423fb3952458abf9c1b1c3284208b7e660344b612cc55da773d61afe4) |
@@ -4410,13 +4411,13 @@ SHA-256: `394ffa61d7dc84ebfd56ad772b59e47be136b95b9549ebf0b77a3bbebf4ce6cc`
| `webhook` | `"notice"` | `deliveryId`: `string`; `provider`: `string`; `ruleId`: `string`; `source`: `string`; `summary`: `string` | [`{ kind: "webhook", form: "notice" }`](#persistence-type-sha256-9edc162949abf93bd5ff049191b345454ba104f583937ce5580fb50f067d2b94) |
| `working-directory` | 未声明 | 无 | [`{ kind: "working-directory" }`](#persistence-type-sha256-2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5) |
<a id="persistence-type-sha256-39fe981d6583647fe76f121c43bd6eac1f1a0d6707297f0901b3078899f9ac92"></a>
<a id="persistence-type-sha256-02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a"></a>
### `Message[]`
SHA-256: `39fe981d6583647fe76f121c43bd6eac1f1a0d6707297f0901b3078899f9ac92`
SHA-256: `02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a`
[`Message`](#persistence-type-sha256-45e3a4c397121e1a2a455c990b4d45852111b64909ced474d41b9f977ac592a4) 的数组。
[`Message`](#persistence-type-sha256-d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7) 的数组。
<a id="persistence-type-sha256-719c51f67074f97034a6c94297fe1f4b5d3c8d392c57586dab732aa5398c7a91"></a>
@@ -4784,7 +4785,7 @@ SHA-256: `b56f6a885da3dc394c69a3e3cc5c0cfc4da15601b63fda4989eee8f40efc5be4`
| `source` | 必需 | [`SessionTitleSource`](#persistence-type-sha256-30d5a537b296685770b1241c4b4bbde19d5a31ff81aa23df73fab5e90b8fc65f) |
| `title` | 必需 | `string` |
<a id="persistence-type-sha256-ee4277d9b4c96ab0a024b3c65d294712b6721808c564162bce7f7feed40c139f"></a>
<a id="persistence-type-sha256-8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69"></a>
<a id="persistence-type-packagessessionsession-title-llmsrcindextssessiontitlellmrequesteventdata"></a>
@@ -4792,7 +4793,7 @@ SHA-256: `b56f6a885da3dc394c69a3e3cc5c0cfc4da15601b63fda4989eee8f40efc5be4`
### `SessionTitleLlmRequestEventData`
SHA-256: `ee4277d9b4c96ab0a024b3c65d294712b6721808c564162bce7f7feed40c139f`
SHA-256: `8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69`
来源:[`packages/session/session-title-llm/src/index.ts:43`](../packages/session/session-title-llm/src/index.ts)
@@ -4800,7 +4801,7 @@ SHA-256: `ee4277d9b4c96ab0a024b3c65d294712b6721808c564162bce7f7feed40c139f`
|---|---|---|
| `maxTokens` | 必需 | `number` |
| `messageSeqs` | 必需 | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
| `messages` | 必需 | [`Message[]`](#persistence-type-sha256-39fe981d6583647fe76f121c43bd6eac1f1a0d6707297f0901b3078899f9ac92) |
| `messages` | 必需 | [`Message[]`](#persistence-type-sha256-02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a) |
| `reasoningEffort` | 可选 | `string` |
| `route` | 必需 | [`SessionTitleModelIdentity`](#persistence-type-sha256-07e1a58c58b593f507b8e7f25723bb0aa42baae6e00f5ecfddf28cb1e64d3235) |
| `system` | 必需 | `string` |
@@ -5479,7 +5480,7 @@ SHA-256: `f1687f982fa3d41ef29e159feed154ecd13af4dd209acaee16038f223f2e9402`
| `interrupted` | 未声明 | 无 | [`{ kind: "interrupted" }`](#persistence-type-sha256-56b7c047694875a843ba020dfea3c8380d54ae4ff88ab349e72004dc21e07c23) |
| `max-tokens` | 未声明 | 无 | [`{ kind: "max-tokens" }`](#persistence-type-sha256-ab7ec5f9eb2c6dfacca5da4c37cf7ba85d04172053ee6b1ebf1709ffcd99c1a7) |
<a id="persistence-type-sha256-0aed9f5c80e82b6e80e92eace5b9e23cd5e58c567d37b4321cd147d51342e212"></a>
<a id="persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499"></a>
<a id="persistence-type-packagesllmllmsrcmessagetsusermessage"></a>
@@ -5487,7 +5488,7 @@ SHA-256: `f1687f982fa3d41ef29e159feed154ecd13af4dd209acaee16038f223f2e9402`
### `UserMessage`
SHA-256: `0aed9f5c80e82b6e80e92eace5b9e23cd5e58c567d37b4321cd147d51342e212`
SHA-256: `120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499`
来源:[`packages/llm/llm/src/message.ts:161`](../packages/llm/llm/src/message.ts)
@@ -5496,19 +5497,19 @@ SHA-256: `0aed9f5c80e82b6e80e92eace5b9e23cd5e58c567d37b4321cd147d51342e212`
| `content` | 必需 | [`ContentBlock[]`](#persistence-type-sha256-b52f215a6cd691058a3413c12f161fa3b563a2f4895adb3df6f744ec4b0a6ef1) |
| `id` | 必需 | `string` |
| `role` | 必需 | `"user"` |
| `source` | 必需 | [`MessageSource`](#persistence-type-sha256-394ffa61d7dc84ebfd56ad772b59e47be136b95b9549ebf0b77a3bbebf4ce6cc) |
| `source` | 必需 | [`MessageSource`](#persistence-type-sha256-7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b) |
消息源兼容策略:`source` — `session-source-attribution` v1; `session.user-message.source`; `kind`; `preserve`.
仅表示归属的新增 kind:`action-cards`, `tmux-context`, `user-question-reply`, `working-directory`.
<a id="persistence-type-sha256-300665af8bcc85dc20a65fd6681ee48d883178731c6f74457ed41539c607bc70"></a>
<a id="persistence-type-sha256-6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85"></a>
### `UserMessage[]`
SHA-256: `300665af8bcc85dc20a65fd6681ee48d883178731c6f74457ed41539c607bc70`
SHA-256: `6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85`
[`UserMessage`](#persistence-type-sha256-0aed9f5c80e82b6e80e92eace5b9e23cd5e58c567d37b4321cd147d51342e212) 的数组。
[`UserMessage`](#persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499) 的数组。
<a id="persistence-type-sha256-c2deb7c9183735d4e0fffddf5c623f4e34daa1c8e96b111982e957dfcbbcf896"></a>
@@ -6143,6 +6144,34 @@ SHA-256: `cbbe8377ee744964537dbafd83607219e58ba79a13f6db0d0645c7ad3d5e8a09`
| `mode` | 必需 | `"external"` |
| `version` | 必需 | `2` |
<a id="persistence-type-sha256-b8ed92a5ca59733f046ea3506d64c35c64044b6a084fd51daee4c6c72727d39f"></a>
### `{ clientTimeZone?, kind: "user" }`
SHA-256: `b8ed92a5ca59733f046ea3506d64c35c64044b6a084fd51daee4c6c72727d39f`
来源:[`packages/sdk/server/src/server.ts:54`](../packages/sdk/server/src/server.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `clientTimeZone` | 可选 | `string` |
| `kind` | 必需 | `"user"` |
<a id="persistence-type-sha256-a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302"></a>
### `{ clientTimeZone?, kind: "user", principal?, rpcId }`
SHA-256: `a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302`
来源:[`packages/api/session-controller/src/types.ts:392`](../packages/api/session-controller/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `clientTimeZone` | 可选 | `string` |
| `kind` | 必需 | `"user"` |
| `principal` | 可选 | [`union (2 variants)`](#persistence-type-sha256-824a4aad44a54e245c67196817d67946734a2dc0eee0b0b6834a5b2a6ef352ce) |
| `rpcId` | 必需 | `string` |
<a id="persistence-type-sha256-a81059ca06999da1e712414520c2c65e491d052fcf9640fae20aa38f0a5dc735"></a>
### `{ code, name, reason? }`
@@ -6473,18 +6502,18 @@ SHA-256: `ad0c38a0adb82a94c925456df41586d9b5f9202fca18593eae2213d4445b4585`
| `reason` | 必需 | [`RequestHeaderReason`](#persistence-type-sha256-530da6c0267813bb4511af72883cc518834e624e3b3220a7062955fd57a788a6) |
| `startsSeries` | 可选 | `true` |
<a id="persistence-type-sha256-129f610271310df606674a5ce5c28b444bbf42c231b0f48ad26a0104ffeb6fde"></a>
<a id="persistence-type-sha256-27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44"></a>
### `{ headerSeq?, message, step, turn }`
SHA-256: `129f610271310df606674a5ce5c28b444bbf42c231b0f48ad26a0104ffeb6fde`
SHA-256: `27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44`
来源:[`packages/core/session/src/types.ts:321`](../packages/core/session/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `headerSeq` | 可选 | `number` |
| `message` | 必需 | [`DeveloperMessage`](#persistence-type-sha256-010783c095f1d9bddbdd2000f3f0a2d31e2ba4a687f2dabf169c5703b98c9def) |
| `message` | 必需 | [`DeveloperMessage`](#persistence-type-sha256-3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7) |
| `step` | 必需 | `number` |
| `turn` | 必需 | `number` |
@@ -6568,17 +6597,17 @@ SHA-256: `17d1afb770d9941936130996da00dc86782cfef731d8d6526162c301256a4ac3`
|---|---|---|
| `inherited` | 可选 | `true` |
<a id="persistence-type-sha256-261128de68865c1f92f2bfa2ccd21f362d6e624cb00fc0cf5558d9d7b82302c5"></a>
<a id="persistence-type-sha256-d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4"></a>
### `{ inserted, outcome?, removedCount?, start, … }`
SHA-256: `261128de68865c1f92f2bfa2ccd21f362d6e624cb00fc0cf5558d9d7b82302c5`
SHA-256: `d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4`
来源:[`packages/core/agent/src/types.ts:110`](../packages/core/agent/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `inserted` | 必需 | [`UserMessage[]`](#persistence-type-sha256-300665af8bcc85dc20a65fd6681ee48d883178731c6f74457ed41539c607bc70) |
| `inserted` | 必需 | [`UserMessage[]`](#persistence-type-sha256-6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85) |
| `outcome` | 可选 | `"canceled"` |
| `removedCount` | 可选 | `number` |
| `start` | 必需 | `number` |
@@ -7871,21 +7900,6 @@ SHA-256: `8fcb0b44a575e998665c053643d1ab04c82f39253ebd190ac0c975b78e40b543`
|---|---|---|
| `kind` | 必需 | `"tool-registry"` |
<a id="persistence-type-sha256-a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302"></a>
### `{ kind: "user" }`
SHA-256: `a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302`
来源:[`packages/api/session-controller/src/types.ts:392`](../packages/api/session-controller/src/types.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
| `clientTimeZone` | 可选 | `string` |
| `kind` | 必需 | `"user"` |
| `principal` | 可选 | [`union (2 variants)`](#persistence-type-sha256-824a4aad44a54e245c67196817d67946734a2dc0eee0b0b6834a5b2a6ef352ce) |
| `rpcId` | 必需 | `string` |
<a id="persistence-type-sha256-6292bcbedaa97feaec5b48a03bb8144b581b93309d9d6c905f26da7a6a7a0a4f"></a>
### `{ kind: "user-approval" }`
@@ -8266,17 +8280,17 @@ SHA-256: `a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b`
| `time` | 必需 | `number` |
| `type` | 必需 | `"agent-preset/selected"` |
<a id="persistence-type-sha256-f5d843edb0eeef61c9f5328599d5f92b61112b7710b0310b043196b15b390d64"></a>
<a id="persistence-type-sha256-5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb"></a>
<a id="persistence-type-eventagentinboxspliced"></a>
### `{ type: "agent/inbox/spliced" }`
SHA-256: `f5d843edb0eeef61c9f5328599d5f92b61112b7710b0310b043196b15b390d64`
SHA-256: `5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb`
| 属性 | 存在性 | 类型 |
|---|---|---|
| `data` | 必需 | [`{ inserted, outcome?, removedCount?, start, … }`](#persistence-type-sha256-261128de68865c1f92f2bfa2ccd21f362d6e624cb00fc0cf5558d9d7b82302c5) |
| `data` | 必需 | [`{ inserted, outcome?, removedCount?, start, … }`](#persistence-type-sha256-d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4) |
| `ignorable` | 可选 | `true` |
| `seq` | 必需 | `number` |
| `time` | 必需 | `number` |
@@ -8517,17 +8531,17 @@ SHA-256: `13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176`
| `time` | 必需 | `number` |
| `type` | 必需 | `"deliverables/presented"` |
<a id="persistence-type-sha256-7ee5a828196d9e4b1672f94f977e68f37125da4297c23029dd682823c09e12fd"></a>
<a id="persistence-type-sha256-53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e"></a>
<a id="persistence-type-eventdevelopermessage"></a>
### `{ type: "developer/message" }`
SHA-256: `7ee5a828196d9e4b1672f94f977e68f37125da4297c23029dd682823c09e12fd`
SHA-256: `53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e`
| 属性 | 存在性 | 类型 |
|---|---|---|
| `data` | 必需 | [`{ headerSeq?, message, step, turn }`](#persistence-type-sha256-129f610271310df606674a5ce5c28b444bbf42c231b0f48ad26a0104ffeb6fde) |
| `data` | 必需 | [`{ headerSeq?, message, step, turn }`](#persistence-type-sha256-27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44) |
| `ignorable` | 可选 | `true` |
| `seq` | 必需 | `number` |
| `sourceEventSeqs` | 可选 | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
@@ -8927,17 +8941,17 @@ SHA-256: `1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5`
| `time` | 必需 | `number` |
| `type` | 必需 | `"session/title"` |
<a id="persistence-type-sha256-4ee17e4219bd5fab6148ec0a8b3ec0fb939edb8f211374cf779bc8135ef9bed2"></a>
<a id="persistence-type-sha256-5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260"></a>
<a id="persistence-type-eventsessiontitle-llm-request"></a>
### `{ type: "session/title-llm-request" }`
SHA-256: `4ee17e4219bd5fab6148ec0a8b3ec0fb939edb8f211374cf779bc8135ef9bed2`
SHA-256: `5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260`
| 属性 | 存在性 | 类型 |
|---|---|---|
| `data` | 必需 | [`SessionTitleLlmRequestEventData`](#persistence-type-sha256-ee4277d9b4c96ab0a024b3c65d294712b6721808c564162bce7f7feed40c139f) |
| `data` | 必需 | [`SessionTitleLlmRequestEventData`](#persistence-type-sha256-8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69) |
| `ignorable` | 可选 | `true` |
| `seq` | 必需 | `number` |
| `time` | 必需 | `number` |
@@ -9376,17 +9390,17 @@ SHA-256: `f1a96afe7503ac1817de769cd0ba13d9b80111c7034c50106b3344ecc14cc515`
| `type` | 必需 | `"usage"` |
| `usage` | 必需 | [`TokenUsage`](#persistence-type-sha256-fec5442b9ee4122e10514d81d5a43648003fe8bfb7ee2ba50c0cdbdd383ed394) |
<a id="persistence-type-sha256-fb6a6e338625067ac582f55dde412a583040cd738bb8fc6820cb0b941c59f05a"></a>
<a id="persistence-type-sha256-3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a"></a>
<a id="persistence-type-eventusermessage"></a>
### `{ type: "user/message" }`
SHA-256: `fb6a6e338625067ac582f55dde412a583040cd738bb8fc6820cb0b941c59f05a`
SHA-256: `3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a`
| 属性 | 存在性 | 类型 |
|---|---|---|
| `data` | 必需 | [`UserMessage`](#persistence-type-sha256-0aed9f5c80e82b6e80e92eace5b9e23cd5e58c567d37b4321cd147d51342e212) |
| `data` | 必需 | [`UserMessage`](#persistence-type-sha256-120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499) |
| `ignorable` | 可选 | `true` |
| `seq` | 必需 | `number` |
| `sourceEventSeqs` | 可选 | [`number[]`](#persistence-type-sha256-5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78) |
@@ -0,0 +1,28 @@
# Bilingual-pair consistency record for 2026-11-09-sdk-prompt-time-zone.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/persistence-changes/2026-11-09-sdk-prompt-time-zone.md
/:
en: 3d5a424ae7d7e46b
zh: c22a8e4a62d8cc1a
/2026-11-09-sdk-prompt-time-zone:
en: 7b78b8897cdcad45
zh: f150e11551183b79
/2026-11-09-sdk-prompt-time-zone/summary:
en: efd312eda323fcd6
zh: 58a84a6bb4f0927b
/2026-11-09-sdk-prompt-time-zone/table-of-contents:
en: 6cf314a069ceb451
zh: 9adff678e9ecab3b
/2026-11-09-sdk-prompt-time-zone/declaration:
en: 6907136f28e48c90
zh: 02f8298485f3d8e7
/2026-11-09-sdk-prompt-time-zone/compatibility:
en: 2cf2990bac782470
zh: c289f1f4e165868b
/2026-11-09-sdk-prompt-time-zone/verification:
en: 0cb1608608505f3e
zh: 4a3bdc35a048de66
/2026-11-09-sdk-prompt-time-zone/dev-note:
en: b75c8458928b72b9
zh: 003ba4e17b4b5269
@@ -0,0 +1,60 @@
---
description: "Records a persistence type transition and its compatibility acknowledgement."
kind: persistence-change
---
# 2026-11-09-sdk-prompt-time-zone
English | [中文](2026-11-09-sdk-prompt-time-zone.zh.md)
## Summary
Adds the sdk-user message source: SDK prompts record an optional canonical clientTimeZone on a user source without rpcId.
## Table of Contents
- [Declaration](#declaration)
- [Compatibility](#compatibility)
- [Verification](#verification)
- [Dev Note](#dev-note)
<a id="declaration"></a>
## Declaration
```yaml persistence-change
schemaVersion: 1
id: 2026-11-09-sdk-prompt-time-zone
baseline: false
changes:
- root: "event:agent/inbox/spliced"
previous: "2026-11-05-timeline-priority-notice"
after: "5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb"
decision: same-version
- root: "event:developer/message"
previous: "2026-11-05-timeline-priority-notice"
after: "53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e"
decision: same-version
- root: "event:session/title-llm-request"
previous: "2026-11-05-timeline-priority-notice"
after: "5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260"
decision: same-version
- root: "event:user/message"
previous: "2026-11-05-timeline-priority-notice"
after: "3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a"
decision: same-version
```
<a id="compatibility"></a>
## Compatibility
The kind stays 'user' and the field is optional, so every existing Session log is unchanged; an SDK prompt without a usable zone writes the same { kind: 'user' } source as before. The writer canonicalizes the zone before commit, and request preparation still refuses a noncanonical value. A current reader of an older log finds no clientTimeZone on SDK prompts and reports the zone as unavailable, as before. A reader that predates this change ignores a clientTimeZone without rpcId and also reports the zone as unavailable; the model-visible time context of recorded requests is replayed from its own logged events, not recomputed from the source. The field is not part of any model request: provider adapters read only the model-visible message content. SESSION_FORMAT_VERSION does not change.
<a id="verification"></a>
## Verification
pnpm exec vitest run packages/sdk/server/tests/time-zone.spec.ts packages/context/time-context/tests: SDK prompts persist the canonical explicit or sampled zone, omit it when the sampled zone is unusable, native commands record none, and an rpcId-free user source contributes its zone to the time context; all tests passed.
<a id="dev-note"></a>
## Dev Note
None.
@@ -0,0 +1,264 @@
{
"formatVersion": 2,
"roots": [
{"key":"event:agent/inbox/spliced","kind":"event","event":"agent/inbox/spliced","surface":false,"digest":"5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb"},
{"key":"event:developer/message","kind":"event","event":"developer/message","surface":true,"digest":"53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e"},
{"key":"event:session/title-llm-request","kind":"event","event":"session/title-llm-request","surface":false,"digest":"5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260"},
{"key":"event:user/message","kind":"event","event":"user/message","surface":true,"digest":"3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a"}
],
"types": [],
"nodes": {
"0203243b72fc867a": {"kind":"object","properties":[{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"02193e4f882eee79": {"kind":"array","element":"d73dbb5105041633"},
"022623b9ef98ec47": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false}],"indices":[]},
"02b2c23f2d94b028": {"kind":"object","properties":[{"name":"kind","type":"c5687b1313206a6f","optional":false}],"indices":[]},
"05205074b24d8340": {"kind":"literal","value":"action-cards"},
"0657d3ca5ac4e7bf": {"kind":"primitive","type":"number"},
"07e1a58c58b593f5": {"kind":"object","properties":[{"name":"model","type":"4cd48f3e5108bd6e","optional":false},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"09655b34d7f3cf1e": {"kind":"literal","value":"system-prompt"},
"09f3f8dc417f2782": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"8af841fc9b265ade","optional":false},{"name":"source","type":"65a8400e451e667e","optional":false}],"indices":[]},
"0a92c5bdfa06c2e2": {"kind":"object","properties":[{"name":"displayName","type":"4cd48f3e5108bd6e","optional":true},{"name":"providerId","type":"4cd48f3e5108bd6e","optional":false},{"name":"subjectId","type":"4cd48f3e5108bd6e","optional":false},{"name":"tenantId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"0ed8d1108fe7a5e1": {"kind":"object","properties":[{"name":"kind","type":"a9059a81430b3207","optional":false}],"indices":[]},
"0eeb17e1df89b1eb": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"0f46153645c29784": {"kind":"object","properties":[{"name":"height","type":"0657d3ca5ac4e7bf","optional":false},{"name":"width","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"0fe52387f6505270": {"kind":"literal","value":"plan-mode"},
"11638dc58a31496f": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"120eda1d93010166": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"68f44f59e91c4139","optional":false},{"name":"source","type":"7ce6b3aae88d0154","optional":false,"compatibility":{"version":1,"policy":"session-source-attribution","binding":"session.user-message.source","discriminator":"kind","unknownKinds":"preserve","attributionKinds":["action-cards","tmux-context","user-question-reply","working-directory"]}}],"indices":[]},
"12d5808fac1996b9": {"kind":"object","properties":[{"name":"attachment","type":"b0b0eb1b16490f6b","optional":false},{"name":"offloaded","type":"dacf3d5f3e4ff619","optional":true},{"name":"type","type":"fb8b6a2e53cb9cf4","optional":false}],"indices":[]},
"1379f0b72275994d": {"kind":"literal","value":"developer/message"},
"16d0507cb94b4cfc": {"kind":"literal","value":"relay"},
"1922cd79a70806c1": {"kind":"literal","value":"skill-invocation"},
"1938c8c20f1cba7c": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false}],"indices":[]},
"1e0b0b66b6f0c53f": {"kind":"literal","value":"aborted"},
"1e709346005826eb": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false}],"indices":[]},
"1ebc6f9ff3aa9e3a": {"kind":"literal","value":"completed"},
"1f0133217eeeffd8": {"kind":"literal","value":"tool-call"},
"1f1385dbc3e875c0": {"kind":"literal","value":"repeat-tool-reminder"},
"1fdad624334d3548": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false}],"indices":[]},
"2152caf1a71e588e": {"kind":"object","properties":[{"name":"kind","type":"2e4debca12f2c449","optional":false},{"name":"messageId","type":"4cd48f3e5108bd6e","optional":false},{"name":"senderId","type":"4cd48f3e5108bd6e","optional":false},{"name":"senderName","type":"4cd48f3e5108bd6e","optional":false},{"name":"teamId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"2235d957bf4b7c6c": {"kind":"object","properties":[{"name":"kind","type":"7b1ce60193fa8b69","optional":false}],"indices":[]},
"224aa11d4d5f88c4": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
"23af3759678a30de": {"kind":"literal","value":"dsh-session-title-llm"},
"24b10f7cdae64928": {"kind":"literal","value":"runtime-context"},
"24ce31aa528272e5": {"kind":"object","properties":[{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"260523b412c19ad8": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"2765e9119edf5816": {"kind":"literal","value":"model"},
"277b61f9c6f81704": {"kind":"literal","value":"file"},
"27f8b01d8292dda6": {"kind":"object","properties":[{"name":"headerSeq","type":"0657d3ca5ac4e7bf","optional":true},{"name":"message","type":"3b64001bcf263052","optional":false},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"28936c614bd4e7e2": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"290f32bfd81ff85a": {"kind":"object","properties":[{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
"297fbd8067d7815a": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false}],"indices":[]},
"2aad1179f9576314": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"2ab12a0e345658f9": {"kind":"array","element":"83da72c6857601c7"},
"2e4debca12f2c449": {"kind":"literal","value":"team-message"},
"2f1e6a7ebace43d7": {"kind":"union","types":["3f74ba74acd10644","58f94390b982f8a5","de30b1fa12c75f81","ebb768d85ec87fb6"]},
"2f3f201c8846e19c": {"kind":"literal","value":"tool-goal"},
"312aee2f0c42aabb": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"31907de956375182": {"kind":"object","properties":[{"name":"compactionId","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"6b23ed9ce1b397e6","optional":false},{"name":"sourceCommandId","type":"4cd48f3e5108bd6e","optional":true}],"indices":[]},
"3247e566f4340029": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"335e242de1fcc17b": {"kind":"union","types":["bcf0caf62d964b2f","e438a9d4fb883b3e"]},
"383cf73ae4748e5b": {"kind":"literal","value":"recall"},
"3a34ff4c0c404f4b": {"kind":"object","properties":[{"name":"data","type":"120eda1d93010166","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"de25352d2dc41963","optional":false}],"indices":[]},
"3b04790e08b35241": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"3b4f2c9ef2c1217e": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false}],"indices":[]},
"3b64001bcf263052": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"589d0d91239681f8","optional":false},{"name":"source","type":"7ce6b3aae88d0154","optional":false,"compatibility":{"version":1,"policy":"session-source-attribution","binding":"session.developer-message.source","discriminator":"kind","unknownKinds":"preserve","attributionKinds":["action-cards","tmux-context","user-question-reply","working-directory"]}}],"indices":[]},
"3bd652ebfa8726b3": {"kind":"union","types":["0657d3ca5ac4e7bf","938f7c7357bc403e"]},
"3bdb8dc6989655b0": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"3c2535ca0a2062f1": {"kind":"literal","value":"reasoning"},
"3e2ece4967cfebe9": {"kind":"literal","value":"next-step"},
"3f74ba74acd10644": {"kind":"literal","value":"image/jpeg"},
"408927267422a7b2": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"43e311235aa537df": {"kind":"object","properties":[{"name":"toolName","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"83d6916021eede8f","optional":false}],"indices":[]},
"45f005e6bbb76452": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"4991dfc415c9efeb": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"49dab019d00e8c26": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"4a561c111a78d452": {"kind":"literal","value":"refusal"},
"4a9bef9f27a94252": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"82470020b5bfcb1a","optional":false},{"name":"senderSessionId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"4b259f7f8f0a44ad": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"isError","type":"aa93010d0e521ad7","optional":true},{"name":"role","type":"a13d8f379222ece8","optional":false},{"name":"source","type":"d9c462b9f62fdd3e","optional":false},{"name":"toolCallId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"4cd48f3e5108bd6e": {"kind":"primitive","type":"string"},
"4d60dddaa65d3da8": {"kind":"object","properties":[{"name":"actor","type":"0a92c5bdfa06c2e2","optional":false},{"name":"kind","type":"6ba7edb6447b6a3e","optional":false},{"name":"shareId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"4e44c9118152f682": {"kind":"literal","value":"text"},
"4e88776858652856": {"kind":"object","properties":[{"name":"text","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"4e44c9118152f682","optional":false}],"indices":[]},
"4edec1b770e8ec4c": {"kind":"literal","value":"ptc-mode"},
"4f91f187baeabef5": {"kind":"object","properties":[{"name":"capturedFormatVersion","type":"0657d3ca5ac4e7bf","optional":true},{"name":"capturedThroughSeq","type":"3bd652ebfa8726b3","optional":false},{"name":"compacted","type":"aa93010d0e521ad7","optional":false},{"name":"inputIndex","type":"0657d3ca5ac4e7bf","optional":false},{"name":"label","type":"4cd48f3e5108bd6e","optional":false},{"name":"omittedBytes","type":"0657d3ca5ac4e7bf","optional":false},{"name":"omittedMessages","type":"0657d3ca5ac4e7bf","optional":false},{"name":"originalMessages","type":"0657d3ca5ac4e7bf","optional":false},{"name":"retainedMessages","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sessionId","type":"4cd48f3e5108bd6e","optional":false},{"name":"truncated","type":"aa93010d0e521ad7","optional":false}],"indices":[]},
"52c6113cb0e53f34": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"53538b9e2b974a81": {"kind":"object","properties":[{"name":"data","type":"27f8b01d8292dda6","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"1379f0b72275994d","optional":false}],"indices":[]},
"53cf1704ae0709c7": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"5509e694e7b11c54": {"kind":"object","properties":[{"name":"data","type":"d7c6a501b0381f8e","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"829a2fb3be6efd4b","optional":false}],"indices":[]},
"5654685d7557ec74": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"58015da1c1950a66": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"587bb11da730e06a": {"kind":"literal","value":"session/title-llm-request"},
"589d0d91239681f8": {"kind":"literal","value":"developer"},
"58f94390b982f8a5": {"kind":"literal","value":"image/png"},
"5bb69b88517f6214": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"5bc66269cfaf614c": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false}],"indices":[]},
"5cdbf342b7748d15": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false}],"indices":[]},
"5d03ba38734809bc": {"kind":"array","element":"0657d3ca5ac4e7bf"},
"5d7a64ed6aac5551": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"5d8b5283839b9337": {"kind":"object","properties":[{"name":"data","type":"8e0a3b4e470f634c","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"587bb11da730e06a","optional":false}],"indices":[]},
"6085488d223aeffd": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"6292bcbedaa97fea": {"kind":"object","properties":[{"name":"kind","type":"f68c335306535a00","optional":false}],"indices":[]},
"62ecb62dc0fe1b5e": {"kind":"literal","value":"next-turn"},
"63ba8895cc09e469": {"kind":"literal","value":"retry"},
"65a8400e451e667e": {"kind":"object","properties":[{"name":"kind","type":"09655b34d7f3cf1e","optional":false}],"indices":[]},
"65d583e66518c523": {"kind":"object","properties":[{"name":"entries","type":"aba175fb20ffc711","optional":false},{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"incomplete","type":"dacf3d5f3e4ff619","optional":true},{"name":"kind","type":"6ebcc2dbec9f2dab","optional":false},{"name":"update","type":"dacf3d5f3e4ff619","optional":true}],"indices":[]},
"672c4aa2a9b736e3": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"1922cd79a70806c1","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"68141cbe3994a5ff": {"kind":"literal","value":"max-tokens"},
"68f44f59e91c4139": {"kind":"literal","value":"user"},
"6b23ed9ce1b397e6": {"kind":"literal","value":"compact-checkpoint"},
"6ba7edb6447b6a3e": {"kind":"literal","value":"share-viewer"},
"6c0f8aded45d4b31": {"kind":"array","element":"120eda1d93010166"},
"6ccb6bc423fb3952": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"6ea608bdc8a7a63d": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false}],"indices":[]},
"6ebcc2dbec9f2dab": {"kind":"literal","value":"skill-catalog"},
"6f22a9d02b9a1f11": {"kind":"object","properties":[{"name":"baseline","type":"dacf3d5f3e4ff619","optional":true},{"name":"baselineIdentity","type":"4cd48f3e5108bd6e","optional":true},{"name":"changes","type":"2ab12a0e345658f9","optional":false},{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"fbd2c74b346a1595","optional":false}],"indices":[]},
"6f44f32be9bcd9a8": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"6f9e00383836275e": {"kind":"literal","value":"snapshot"},
"719c51f67074f970": {"kind":"object","properties":[{"name":"kind","type":"2765e9119edf5816","optional":false},{"name":"model","type":"4cd48f3e5108bd6e","optional":false},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false},{"name":"replayState","type":"bbc5696e3f13c758","optional":true}],"indices":[]},
"7382c4fc95fe8c5d": {"kind":"literal","value":"remove"},
"7554565be416b034": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"756b5e23a5cb2c7f": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"78a9be340090b735": {"kind":"literal","value":"tmux-context"},
"7b1ce60193fa8b69": {"kind":"literal","value":"working-directory"},
"7ce6b3aae88d0154": {"kind":"union","types":["0203243b72fc867a","022623b9ef98ec47","02b2c23f2d94b028","0ed8d1108fe7a5e1","0eeb17e1df89b1eb","11638dc58a31496f","1938c8c20f1cba7c","1e709346005826eb","1fdad624334d3548","2152caf1a71e588e","2235d957bf4b7c6c","224aa11d4d5f88c4","24ce31aa528272e5","260523b412c19ad8","28936c614bd4e7e2","290f32bfd81ff85a","297fbd8067d7815a","2aad1179f9576314","312aee2f0c42aabb","31907de956375182","3247e566f4340029","3b04790e08b35241","3b4f2c9ef2c1217e","3bdb8dc6989655b0","408927267422a7b2","45f005e6bbb76452","4991dfc415c9efeb","49dab019d00e8c26","4a9bef9f27a94252","52c6113cb0e53f34","53cf1704ae0709c7","5654685d7557ec74","58015da1c1950a66","5bb69b88517f6214","5bc66269cfaf614c","5cdbf342b7748d15","5d7a64ed6aac5551","6085488d223aeffd","6292bcbedaa97fea","65a8400e451e667e","65d583e66518c523","672c4aa2a9b736e3","6ccb6bc423fb3952","6ea608bdc8a7a63d","6f22a9d02b9a1f11","6f44f32be9bcd9a8","719c51f67074f970","7554565be416b034","756b5e23a5cb2c7f","7df62978a2b7de85","7eaef7a763ba5b94","7f959241c24128b4","80677c8c8b804189","825ca23416b1ea9d","8338ee303e2bd448","848639f8787f035b","854db3efdfb0cd39","85fe96bf15d5c755","8620189c8e335827","87b1a33564b9a4d6","88841202942c7683","8a046b52331959aa","8c1c4f72755a78ea","8c627d7a45fa406c","8f1062573ea91841","8f324cea3916c051","8fcb0b44a575e998","96bfb916a727cd44","99135d8a39379779","99f0e98184709ad1","9edc162949abf93b","9f65c43e340bba31","a15a19ef63cf5d1b","a16e567c8cd2c55c","a2066bd52f61218b","a3c6f1ea38e9a61d","a4afec59b75aad5d","aa2bf9e82b9fdeb9","aae343bc3d663c83","ada310bf0bdb8fed","ade057f4fdc387ae","b062078e899958f9","b2a5c8c008a31e3d","b3681c026a0b98e9","b4ec0af39fd52ed9","b613f83572fe2fbf","b6f94c17dd9bbd7c","b70f3e81fe11b7a5","b79641a9d25e7566","b8ed92a5ca59733f","ba2a1a8f194b1bb2","ba4c40b4381e0dcd","baccc97ec34be6c4","c5228b7a55498d84","c55827fba7018198","cb1c8959e1726f82","cda2345a9be9d139","d215701afb7aafbf","d85590a5675c6e2f","d9c462b9f62fdd3e","db06ef35b27a3842","dba54c09c6e7aafc","dd00cdccd0ba487b","dd5ee8762bd8a14b","dd6cc2bb2a8f2824","dde0cdf9d426768b","deaae5cd30987d4f","e7f4cbb3a57f4cbd","edbbfff1128099fd","ee577a0cc18664c9","f230c0b583e23b25","f29d63336e8266d8","f4a66f654996c093","f56c5b59ca016131","f6329fb30c7ea801","f6605d6c57933aea","f6afe41e3926f422","f7283223aacdc39b","f97f47b0eb87905e","fcf81d3c58c13593","fe1a7acdeed4d0f5"]},
"7df62978a2b7de85": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false}],"indices":[]},
"7eaef7a763ba5b94": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
"7f13860ee89a2d35": {"kind":"literal","value":"session-reference"},
"7f959241c24128b4": {"kind":"object","properties":[{"name":"goalId","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"b815d7b91cdd9fc6","optional":false},{"name":"revision","type":"0657d3ca5ac4e7bf","optional":false},{"name":"round","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"8064c03c87c357fd": {"kind":"union","types":["12d5808fac1996b9","43e311235aa537df","4e88776858652856","814d9434e1ddf907","8e611bf46821e500","c1f0f17b6493b85d","f2da0f27c1e6add5"]},
"80677c8c8b804189": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
"8067b0d232c350f1": {"kind":"literal","value":"time-context"},
"814d9434e1ddf907": {"kind":"object","properties":[{"name":"text","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"3c2535ca0a2062f1","optional":false}],"indices":[]},
"82470020b5bfcb1a": {"kind":"literal","value":"agent-message"},
"824a4aad44a54e24": {"kind":"union","types":["4d60dddaa65d3da8","deebfc7c62177ea8"]},
"825ca23416b1ea9d": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false}],"indices":[]},
"829a2fb3be6efd4b": {"kind":"literal","value":"agent/inbox/spliced"},
"83079c8a3f733ac3": {"kind":"object","properties":[{"name":"description","type":"4cd48f3e5108bd6e","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"8338ee303e2bd448": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"83d6916021eede8f": {"kind":"literal","value":"tool-removal"},
"83da72c6857601c7": {"kind":"object","properties":[{"name":"action","type":"904bf499d98be4a3","optional":false},{"name":"digest","type":"4cd48f3e5108bd6e","optional":true},{"name":"path","type":"4cd48f3e5108bd6e","optional":false},{"name":"scope","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"848639f8787f035b": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"bf16d2e98a7f1389","optional":false},{"name":"senderSessionId","type":"4cd48f3e5108bd6e","optional":false},{"name":"stopReason","type":"866f7b2dbdc5b421","optional":true},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"854db3efdfb0cd39": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"85d6d96ff8842974": {"kind":"literal","value":"answered"},
"85f9b505b7bdff1f": {"kind":"literal","value":"tool-addition"},
"85fe96bf15d5c755": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"8620189c8e335827": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"866f7b2dbdc5b421": {"kind":"union","types":["1e0b0b66b6f0c53f","1ebc6f9ff3aa9e3a","4a561c111a78d452","68141cbe3994a5ff","a2be0f0cb59f0d4a"]},
"86e1e384495ee09a": {"kind":"object","properties":[{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"text","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"87b1a33564b9a4d6": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false}],"indices":[]},
"88841202942c7683": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"8a046b52331959aa": {"kind":"object","properties":[{"name":"kind","type":"78a9be340090b735","optional":false}],"indices":[]},
"8af841fc9b265ade": {"kind":"literal","value":"system"},
"8c1c4f72755a78ea": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"8c627d7a45fa406c": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"8e0a3b4e470f634c": {"kind":"object","properties":[{"name":"maxTokens","type":"0657d3ca5ac4e7bf","optional":false},{"name":"messageSeqs","type":"5d03ba38734809bc","optional":false},{"name":"messages","type":"02193e4f882eee79","optional":false},{"name":"reasoningEffort","type":"4cd48f3e5108bd6e","optional":true},{"name":"route","type":"07e1a58c58b593f5","optional":false},{"name":"system","type":"4cd48f3e5108bd6e","optional":false},{"name":"titleProvider","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"8e611bf46821e500": {"kind":"object","properties":[{"name":"tool","type":"fcf427290c6213c2","optional":true},{"name":"toolName","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"85f9b505b7bdff1f","optional":false}],"indices":[]},
"8f1062573ea91841": {"kind":"object","properties":[{"name":"clientTimeZone","type":"4cd48f3e5108bd6e","optional":true},{"name":"kind","type":"63ba8895cc09e469","optional":false},{"name":"principal","type":"824a4aad44a54e24","optional":true},{"name":"rpcId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"8f324cea3916c051": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"8fcb0b44a575e998": {"kind":"object","properties":[{"name":"kind","type":"a720757f704a2512","optional":false}],"indices":[]},
"904bf499d98be4a3": {"kind":"union","types":["7382c4fc95fe8c5d","b765ee31033cea46","f6cb462f808309e3"]},
"938f7c7357bc403e": {"kind":"primitive","type":"null"},
"95a3ffccbf3c8afc": {"kind":"literal","value":"owner"},
"95c0e88fcf0bafb2": {"kind":"literal","value":"assistant"},
"9645cf93769a6dfb": {"kind":"literal","value":"user-question-reply"},
"96bfb916a727cd44": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"96f4a9c81fc0f940": {"kind":"union","types":["3e2ece4967cfebe9","62ecb62dc0fe1b5e"]},
"99135d8a39379779": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false}],"indices":[]},
"99e7e7d7fed55ae6": {"kind":"literal","value":"tool-jobs"},
"99f0e98184709ad1": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false}],"indices":[]},
"9ac52f0f84fec2eb": {"kind":"literal","value":"model-selection"},
"9edc162949abf93b": {"kind":"object","properties":[{"name":"deliveryId","type":"4cd48f3e5108bd6e","optional":false},{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"db6c5246911d47a7","optional":false},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false},{"name":"ruleId","type":"4cd48f3e5108bd6e","optional":false},{"name":"source","type":"4cd48f3e5108bd6e","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"9f65c43e340bba31": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false}],"indices":[]},
"a13d8f379222ece8": {"kind":"literal","value":"tool"},
"a15a19ef63cf5d1b": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false}],"indices":[]},
"a16e567c8cd2c55c": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false}],"indices":[]},
"a2066bd52f61218b": {"kind":"object","properties":[{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"a2be0f0cb59f0d4a": {"kind":"literal","value":"error"},
"a3c6f1ea38e9a61d": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"a4afec59b75aad5d": {"kind":"object","properties":[{"name":"clientTimeZone","type":"4cd48f3e5108bd6e","optional":true},{"name":"kind","type":"68f44f59e91c4139","optional":false},{"name":"principal","type":"824a4aad44a54e24","optional":true},{"name":"rpcId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"a720757f704a2512": {"kind":"literal","value":"tool-registry"},
"a9059a81430b3207": {"kind":"literal","value":"hooks-claude-code"},
"aa2bf9e82b9fdeb9": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false}],"indices":[]},
"aa93010d0e521ad7": {"kind":"primitive","type":"boolean"},
"aae343bc3d663c83": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false}],"indices":[]},
"aba175fb20ffc711": {"kind":"array","element":"83079c8a3f733ac3"},
"ada310bf0bdb8fed": {"kind":"object","properties":[{"name":"kind","type":"68f44f59e91c4139","optional":false}],"indices":[]},
"ade057f4fdc387ae": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"aec150797b655c5f": {"kind":"literal","value":"catalog"},
"b062078e899958f9": {"kind":"object","properties":[{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"b0b0eb1b16490f6b": {"kind":"object","properties":[{"name":"attachmentId","type":"4cd48f3e5108bd6e","optional":false},{"name":"bytes","type":"0657d3ca5ac4e7bf","optional":false},{"name":"height","type":"0657d3ca5ac4e7bf","optional":false},{"name":"mediaType","type":"2f1e6a7ebace43d7","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":true},{"name":"originalDimensions","type":"0f46153645c29784","optional":true},{"name":"width","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"b2a5c8c008a31e3d": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
"b3681c026a0b98e9": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"b4ec0af39fd52ed9": {"kind":"object","properties":[{"name":"kind","type":"bb94f3217aa56c88","optional":false}],"indices":[]},
"b52f215a6cd69105": {"kind":"array","element":"8064c03c87c357fd"},
"b613f83572fe2fbf": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"b6f94c17dd9bbd7c": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false}],"indices":[]},
"b70f3e81fe11b7a5": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false}],"indices":[]},
"b765ee31033cea46": {"kind":"literal","value":"set"},
"b79641a9d25e7566": {"kind":"object","properties":[{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"b815d7b91cdd9fc6": {"kind":"literal","value":"goal"},
"b8ed92a5ca59733f": {"kind":"object","properties":[{"name":"clientTimeZone","type":"4cd48f3e5108bd6e","optional":true},{"name":"kind","type":"68f44f59e91c4139","optional":false}],"indices":[]},
"ba2a1a8f194b1bb2": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"ba4c40b4381e0dcd": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"baccc97ec34be6c4": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"bb94f3217aa56c88": {"kind":"literal","value":"hooks-codex"},
"bbc5696e3f13c758": {"kind":"opaque","reason":"unknown"},
"bcf0caf62d964b2f": {"kind":"object","properties":[{"name":"endSeq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"op","type":"f6cb462f808309e3","optional":false},{"name":"startSeq","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"bf16d2e98a7f1389": {"kind":"literal","value":"subagent-settled"},
"c1f0f17b6493b85d": {"kind":"object","properties":[{"name":"arguments","type":"4cd48f3e5108bd6e","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"1f0133217eeeffd8","optional":false}],"indices":[]},
"c5228b7a55498d84": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"c55827fba7018198": {"kind":"object","properties":[{"name":"callId","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"9645cf93769a6dfb","optional":false},{"name":"outcome","type":"85d6d96ff8842974","optional":false}],"indices":[]},
"c5687b1313206a6f": {"kind":"literal","value":"cordis-host-runner"},
"c748fb42c80a1200": {"kind":"array","element":"86e1e384495ee09a"},
"c77ac037cb8af460": {"kind":"literal","value":"timeline-priority"},
"cb1c8959e1726f82": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"cda2345a9be9d139": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"d215701afb7aafbf": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"c77ac037cb8af460","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"d4e4d575abeb4b72": {"kind":"literal","value":"canceled"},
"d73dbb5105041633": {"kind":"union","types":["09f3f8dc417f2782","120eda1d93010166","3b64001bcf263052","4b259f7f8f0a44ad","fa87537f4a9c1e25"]},
"d7c6a501b0381f8e": {"kind":"object","properties":[{"name":"inserted","type":"6c0f8aded45d4b31","optional":false},{"name":"outcome","type":"d4e4d575abeb4b72","optional":true},{"name":"removedCount","type":"0657d3ca5ac4e7bf","optional":true},{"name":"start","type":"0657d3ca5ac4e7bf","optional":false},{"name":"target","type":"96f4a9c81fc0f940","optional":false}],"indices":[]},
"d85590a5675c6e2f": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"d9c462b9f62fdd3e": {"kind":"object","properties":[{"name":"callId","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"a13d8f379222ece8","optional":false}],"indices":[]},
"d9edf1862e4471d6": {"kind":"literal","value":"schedule"},
"dacf3d5f3e4ff619": {"kind":"literal","value":true},
"db06ef35b27a3842": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"db6c5246911d47a7": {"kind":"literal","value":"webhook"},
"dba54c09c6e7aafc": {"kind":"object","properties":[{"name":"kind","type":"4edec1b770e8ec4c","optional":false}],"indices":[]},
"dd00cdccd0ba487b": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"dd5ee8762bd8a14b": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"dd6cc2bb2a8f2824": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"dde0cdf9d426768b": {"kind":"object","properties":[{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"de25352d2dc41963": {"kind":"literal","value":"user/message"},
"de30b1fa12c75f81": {"kind":"literal","value":"image/gif"},
"deaae5cd30987d4f": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"deebfc7c62177ea8": {"kind":"object","properties":[{"name":"kind","type":"95a3ffccbf3c8afc","optional":false}],"indices":[]},
"df843efd87c78cf8": {"kind":"array","element":"4f91f187baeabef5"},
"e438a9d4fb883b3e": {"kind":"literal","value":"append"},
"e7f4cbb3a57f4cbd": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"e8de0f457fed5b9f": {"kind":"literal","value":"notice"},
"ebb768d85ec87fb6": {"kind":"literal","value":"image/webp"},
"edbbfff1128099fd": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"ee577a0cc18664c9": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"f19bee84bf3d2090": {"kind":"object","properties":[{"name":"attachmentId","type":"4cd48f3e5108bd6e","optional":false},{"name":"bytes","type":"0657d3ca5ac4e7bf","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"f230c0b583e23b25": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"f29d63336e8266d8": {"kind":"object","properties":[{"name":"kind","type":"d9edf1862e4471d6","optional":false}],"indices":[]},
"f2da0f27c1e6add5": {"kind":"object","properties":[{"name":"attachment","type":"f19bee84bf3d2090","optional":false},{"name":"type","type":"277b61f9c6f81704","optional":false}],"indices":[]},
"f4a66f654996c093": {"kind":"object","properties":[{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"f56c5b59ca016131": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"7f13860ee89a2d35","optional":false},{"name":"references","type":"df843efd87c78cf8","optional":false},{"name":"version","type":"f88f1b7b6bb733f6","optional":false}],"indices":[]},
"f6329fb30c7ea801": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"f6605d6c57933aea": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false}],"indices":[]},
"f68c335306535a00": {"kind":"literal","value":"user-approval"},
"f6afe41e3926f422": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"f6cb462f808309e3": {"kind":"literal","value":"replace"},
"f7283223aacdc39b": {"kind":"object","properties":[{"name":"kind","type":"9ac52f0f84fec2eb","optional":false}],"indices":[]},
"f88f1b7b6bb733f6": {"kind":"literal","value":1},
"f97f47b0eb87905e": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false}],"indices":[]},
"fa87537f4a9c1e25": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"95c0e88fcf0bafb2","optional":false},{"name":"source","type":"719c51f67074f970","optional":false}],"indices":[]},
"fb8b6a2e53cb9cf4": {"kind":"literal","value":"image"},
"fbd2c74b346a1595": {"kind":"literal","value":"agent-instructions"},
"fcf427290c6213c2": {"kind":"primitive","type":"never"},
"fcf81d3c58c13593": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false}],"indices":[]},
"fe1a7acdeed4d0f5": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"fee1caf8ab6a65c1": {"kind":"literal","value":"instructions"}
}
}
@@ -0,0 +1,60 @@
---
description: "记录持久化类型更改及其兼容性确认。"
kind: persistence-change
---
# 2026-11-09-sdk-prompt-time-zone
[English](2026-11-09-sdk-prompt-time-zone.md) | 中文
## 概述
新增 sdk-user 消息来源:SDK prompt 在不带 rpcId 的 user 来源上记录可选的规范化 clientTimeZone。
## 目录
- [声明](#declaration)
- [兼容性](#compatibility)
- [验证](#verification)
- [开发备注](#dev-note)
<a id="declaration"></a>
## 声明
```yaml persistence-change
schemaVersion: 1
id: 2026-11-09-sdk-prompt-time-zone
baseline: false
changes:
- root: "event:agent/inbox/spliced"
previous: "2026-11-05-timeline-priority-notice"
after: "5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb"
decision: same-version
- root: "event:developer/message"
previous: "2026-11-05-timeline-priority-notice"
after: "53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e"
decision: same-version
- root: "event:session/title-llm-request"
previous: "2026-11-05-timeline-priority-notice"
after: "5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260"
decision: same-version
- root: "event:user/message"
previous: "2026-11-05-timeline-priority-notice"
after: "3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a"
decision: same-version
```
<a id="compatibility"></a>
## 兼容性
kind 仍为 'user',字段可选,因此所有既有 Session 日志都不变;没有可用时区的 SDK prompt 仍写入与之前相同的 { kind: 'user' } 来源。写入方在提交前规范化时区,请求准备阶段仍拒绝非规范值。当前读取方读取旧日志时,SDK prompt 上没有 clientTimeZone,与之前一样报告时区不可用。早于本更改的读取方忽略不带 rpcId 的 clientTimeZone,同样报告时区不可用;已记录请求的模型可见时间上下文从其自身记录的事件回放,不从来源重新计算。该字段不进入任何模型请求:provider 适配器只读取模型可见的消息内容。SESSION_FORMAT_VERSION 不变。
<a id="verification"></a>
## 验证
pnpm exec vitest run packages/sdk/server/tests/time-zone.spec.ts packages/context/time-context/tests:SDK prompt 持久化规范化后的显式或采样时区,采样时区不可用时不写该字段,原生命令不记录时区,不带 rpcId 的 user 来源向时间上下文提供其时区;全部测试通过。
<a id="dev-note"></a>
## 开发备注
无。
@@ -15,8 +15,8 @@
en: 14c57f30e676f6e3
zh: b1a0ccf26fab3727
/session-persistence-formats/format-references:
en: d0b94efc6bce9073
zh: 0bc584a91a013c98
en: 8d508263179b3354
zh: 2c75bdc2f433764a
/session-persistence-formats/scope-and-evidence:
en: 44ba17a168ec63ac
zh: c80a44bdbf17a174
@@ -32,7 +32,7 @@ The index is generated from validated snapshots and the current writer constant.
| 1 | PR #3349 | [V1](v1.md) | [JSON](v1.schema.json) | 54 / 415 |
| 2 | `dsh-v0.1.3-alpha.2` | [V2](v2.md) | [JSON](v2.schema.json) | 56 / 435 |
| 3 | PR #4320 | [V3](v3.md) | [JSON](v3.schema.json) | 60 / 467 |
| 4 | Current checkout | [Current catalog](../../persistence-catalog.md) | [JSON](../../persistence-schema.json) | 67 / 640 |
| 4 | Current checkout | [Current catalog](../../persistence-catalog.md) | [JSON](../../persistence-schema.json) | 67 / 641 |
<!-- persistence-format-index:end -->
@@ -32,7 +32,7 @@ description: "查找从 V0 到工作区写入器版本的每个 Session 格式
| 1 | PR #3349 | [V1](v1.zh.md) | [JSON](v1.schema.json) | 54 / 415 |
| 2 | `dsh-v0.1.3-alpha.2` | [V2](v2.zh.md) | [JSON](v2.schema.json) | 56 / 435 |
| 3 | PR #4320 | [V3](v3.zh.md) | [JSON](v3.schema.json) | 60 / 467 |
| 4 | 当前工作树 | [当前目录](../../persistence-catalog.zh.md) | [JSON](../../persistence-schema.json) | 67 / 640 |
| 4 | 当前工作树 | [当前目录](../../persistence-catalog.zh.md) | [JSON](../../persistence-schema.json) | 67 / 641 |
<!-- persistence-format-index:end -->
+32 -30
View File
@@ -5,7 +5,7 @@
{"key":"JsonlHeaderLine","kind":"header","digest":"18ee62b8900a4c3d046700f05d7a4d49d6cab2a660a020c87481d1603dd8bd4f"},
{"key":"SessionEventEnvelope","kind":"envelope","digest":"5776e5553ff2dfe3f5bc202dbb1e7c9f93e35a531aebb7764c23b2b6153b2ccc"},
{"key":"event:agent-preset/selected","kind":"event","event":"agent-preset/selected","surface":false,"digest":"a10c17474eaf2ddab7095a099e0fe3d046fc18e56c3e344fc8894c05ff9ef97b"},
{"key":"event:agent/inbox/spliced","kind":"event","event":"agent/inbox/spliced","surface":false,"digest":"f5d843edb0eeef61c9f5328599d5f92b61112b7710b0310b043196b15b390d64"},
{"key":"event:agent/inbox/spliced","kind":"event","event":"agent/inbox/spliced","surface":false,"digest":"5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb"},
{"key":"event:approval/asked","kind":"event","event":"approval/asked","surface":false,"digest":"3bfeb47b58606f4661904bc723da612782214c463d01e6d61cd6d6193d7374e1"},
{"key":"event:approval/decided","kind":"event","event":"approval/decided","surface":false,"digest":"bb1ab3d08f49a9f3b265f844cd78d5c49813062a7b34b54904b426f85d0ff6e3"},
{"key":"event:approval/policy","kind":"event","event":"approval/policy","surface":false,"digest":"26718e15e7e395bce9642dba5bbe09b3b1a4ce2213d20d566cd9207d7fc5fb78"},
@@ -18,7 +18,7 @@
{"key":"event:compaction/start","kind":"event","event":"compaction/start","surface":false,"digest":"db874d463b0fdec77e9da1c4568f37cb70bd6596781eb93800db44fb8a116965"},
{"key":"event:compaction/summary","kind":"event","event":"compaction/summary","surface":false,"digest":"e2f9a41e0989f54ed8cee80f8db2bcf9d60a5c810dc9d45b83fa050b9dce7602"},
{"key":"event:deliverables/presented","kind":"event","event":"deliverables/presented","surface":false,"digest":"13d3d180f977bf78081d487ffa0ecb75857349bcab29a5a3fb48189fca2a6176"},
{"key":"event:developer/message","kind":"event","event":"developer/message","surface":true,"digest":"7ee5a828196d9e4b1672f94f977e68f37125da4297c23029dd682823c09e12fd"},
{"key":"event:developer/message","kind":"event","event":"developer/message","surface":true,"digest":"53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e"},
{"key":"event:feedback/message-delete","kind":"event","event":"feedback/message-delete","surface":false,"digest":"3ee93b06f3a125850337602bcdf155d2538c43a5c944ec55b1b3c365152d6796"},
{"key":"event:feedback/message-put","kind":"event","event":"feedback/message-put","surface":false,"digest":"b5086d249e8502e9ead1d39156bb8d559bde7951cac0f14ce150345b4e42a2bf"},
{"key":"event:feedback/record","kind":"event","event":"feedback/record","surface":false,"digest":"b54940ff095c17e874c5be03815f4c2145a256cf3a1d34dae4ab2f7769dfffe8"},
@@ -40,7 +40,7 @@
{"key":"event:session-log-deepseek/delivery-accepted","kind":"event","event":"session-log-deepseek/delivery-accepted","surface":false,"digest":"d63b8b8ffad9c02fd80c43a17df4f240c1fe8118ecca9de34f9d5871838ab5b9"},
{"key":"event:session/end-seed","kind":"event","event":"session/end-seed","surface":false,"digest":"5e6db6e24948d4a853c71cb9fabd252ad051ce93d4672c1266cf837c1c17b84e"},
{"key":"event:session/title","kind":"event","event":"session/title","surface":false,"digest":"1b912703e2d64f91c99c675b8f805b01076c8325b905c1218ad81ef0b24909d5"},
{"key":"event:session/title-llm-request","kind":"event","event":"session/title-llm-request","surface":false,"digest":"4ee17e4219bd5fab6148ec0a8b3ec0fb939edb8f211374cf779bc8135ef9bed2"},
{"key":"event:session/title-llm-request","kind":"event","event":"session/title-llm-request","surface":false,"digest":"5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260"},
{"key":"event:step/end","kind":"event","event":"step/end","surface":false,"digest":"e0a787e6ec76c7c94fecbc501b489164ab0293db05bc947914077ad01e674f05"},
{"key":"event:step/start","kind":"event","event":"step/start","surface":false,"digest":"4513e088d43e6c68425be30451b9f961cc264fe7318ca62681c41d4d78615986"},
{"key":"event:subagent/catalog","kind":"event","event":"subagent/catalog","surface":false,"digest":"d49164d37eab0f0f70fa787c65d887abbea869c010ccb103d717fab3519c3a41"},
@@ -63,16 +63,16 @@
{"key":"event:tool/result","kind":"event","event":"tool/result","surface":true,"digest":"7c9f44e90a0058f4cc532ae20dad0c10afa6eba22e70a6c79fc79490bad64397"},
{"key":"event:turn/end","kind":"event","event":"turn/end","surface":false,"digest":"0f8512903d94f57a4748fa1a2092e64342856796684e6b8343db685b192745ce"},
{"key":"event:turn/start","kind":"event","event":"turn/start","surface":false,"digest":"aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8"},
{"key":"event:user/message","kind":"event","event":"user/message","surface":true,"digest":"fb6a6e338625067ac582f55dde412a583040cd738bb8fc6820cb0b941c59f05a"},
{"key":"event:user/message","kind":"event","event":"user/message","surface":true,"digest":"3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a"},
{"key":"event:web/deepseek-search-llm-request","kind":"event","event":"web/deepseek-search-llm-request","surface":false,"digest":"0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52"},
{"key":"event:working-directory/change","kind":"event","event":"working-directory/change","surface":false,"digest":"124aa62078ca3311353b39cc3bf6c75da281338be6bbf672f8b361d828cddca3"},
{"key":"event:workspace-root/change","kind":"event","event":"workspace-root/change","surface":false,"digest":"025f11632cd02aaecc23a46c3b5bf43b9009d88293ed9b35ccbc1139d73334dc"},
{"key":"event:workspace/changes","kind":"event","event":"workspace/changes","surface":false,"digest":"e308ccf867a5398e316e0af8cb6ce238a8d33a63b9b384c8250a686786285f72"}
],
"types": [
{"digest":"010783c095f1d9bddbdd2000f3f0a2d31e2ba4a687f2dabf169c5703b98c9def","names":["packages/llm/llm/src/message.ts#DeveloperMessage"],"sources":["packages/llm/llm/src/message.ts:156"]},
{"digest":"0116b1f89c05221d56b0ba35c83d302bf4857bc7277d247e9bbaf74b27d2c66e","names":[],"sources":[]},
{"digest":"0203243b72fc867afc81aff5f4cf2167e564ed342534eb612fc92f295cf07789","names":[],"sources":[]},
{"digest":"02193e4f882eee79523902b49c0f93d92eb5fc85aaa747c39bba9f42d319329a","names":[],"sources":[]},
{"digest":"022623b9ef98ec47ec3c3bae0c51027c70d2601141c5e92e26a0d83d1b4cef06","names":[],"sources":[]},
{"digest":"023a355b2be0d688fb6e4df8388dadb942761d46cfe96d0f499aae9631a159d4","names":[],"sources":["packages/core/session/src/types.ts:215"]},
{"digest":"025f11632cd02aaecc23a46c3b5bf43b9009d88293ed9b35ccbc1139d73334dc","names":[],"sources":[]},
@@ -92,7 +92,6 @@
{"digest":"0a92c5bdfa06c2e2615b777728f3aa95f408d43b9012e7b754568311251db623","names":[],"sources":["packages/experimental/liveshare/src/host/viewer-principal.ts:29"]},
{"digest":"0aa62ab51b36c0e64b134bd03ba8725d758744180a1a447da49beaad194f219f","names":[],"sources":[]},
{"digest":"0acd94fe8794574c9ae72c7855ee16d29c546096d4af760d16d1225385764555","names":["packages/llm/llm/src/types.ts#ReplayEnvelope"],"sources":["packages/llm/llm/src/types.ts:474"]},
{"digest":"0aed9f5c80e82b6e80e92eace5b9e23cd5e58c567d37b4321cd147d51342e212","names":["packages/llm/llm/src/message.ts#UserMessage"],"sources":["packages/llm/llm/src/message.ts:161"]},
{"digest":"0af3ecfb8c60d416fc40a7cc4fb2c4851a8e46608b2b38ab9e510670c971aa1f","names":[],"sources":[]},
{"digest":"0b6d718c693fdf7f06dcccb0bcbbabe78cc63514eafc62d6b2a3899735279d6f","names":["packages/goal/goal/src/types.ts#GoalRef"],"sources":["packages/goal/goal/src/types.ts:20"]},
{"digest":"0b9b8facbe2c19773b3fb0ecc824ccbcc603d41b8f18069faa3807d449572fce","names":[],"sources":[]},
@@ -113,8 +112,8 @@
{"digest":"11638dc58a31496fb6706ced3e23e3a2db1f3b2a8845968c810827a72b5fc811","names":[],"sources":[]},
{"digest":"119abe2b9c0b2f46ecb31d82b9acba4d4b30e049f655e2475e8b4ae12d5a9e25","names":[],"sources":["packages/experimental/hook-protocol/src/types.ts:19"]},
{"digest":"11f70b595aa76897fc4e25a352bfa718c659f44b799e5aa14e84e5a38fe72912","names":[],"sources":["packages/interaction/user-approval/src/index.ts:41"]},
{"digest":"120eda1d93010166aa81e87bc16c09cb4deae354737521e9e54fd42d535db499","names":["packages/llm/llm/src/message.ts#UserMessage"],"sources":["packages/llm/llm/src/message.ts:161"]},
{"digest":"124aa62078ca3311353b39cc3bf6c75da281338be6bbf672f8b361d828cddca3","names":[],"sources":[]},
{"digest":"129f610271310df606674a5ce5c28b444bbf42c231b0f48ad26a0104ffeb6fde","names":[],"sources":["packages/core/session/src/types.ts:321"]},
{"digest":"12a0cfa619ac4a5fc6c3e8e359c8dae15769edc61497a575935c78d5842f8e42","names":[],"sources":[]},
{"digest":"12d5808fac1996b9b3c2afa806e03022252ba2d7b88f835862ae1896591f60c7","names":["packages/llm/llm/src/types.ts#ImageBlock"],"sources":["packages/llm/llm/src/types.ts:86"]},
{"digest":"1379f0b72275994d20f1ddca2d60a96ab16ec80397ca9f1af21bdc67ba5c269c","names":[],"sources":[]},
@@ -173,11 +172,11 @@
{"digest":"24ce31aa528272e59f21cd26da9eca08968bcc97529756a749bfdab71746d9c8","names":[],"sources":[]},
{"digest":"254dce209e735f9cb6f6b7aec0354712b1611759ec02af4d35a96f2081e666f6","names":[],"sources":[]},
{"digest":"260523b412c19ad8c2bb00093b07f64245ff8ba6b2f76c5b545303772ac9704c","names":[],"sources":[]},
{"digest":"261128de68865c1f92f2bfa2ccd21f362d6e624cb00fc0cf5558d9d7b82302c5","names":[],"sources":["packages/core/agent/src/types.ts:110"]},
{"digest":"26718e15e7e395bce9642dba5bbe09b3b1a4ce2213d20d566cd9207d7fc5fb78","names":[],"sources":[]},
{"digest":"26c879bdd130e8b8683a6ce588414fad2244783d6573ca399fa0de184a2b0bb1","names":[],"sources":[]},
{"digest":"2765e9119edf5816ac1ab4c95c5ee32c90403f3742962eff11544f7752d59d2e","names":[],"sources":[]},
{"digest":"277b61f9c6f8170425fa6ffe06cfa14376757a896a4749cb82a687d7364c4fc9","names":[],"sources":[]},
{"digest":"27f8b01d8292dda6a9b9d907fc0e8c811836301d0b9cd225afe9d60bbc367f44","names":[],"sources":["packages/core/session/src/types.ts:321"]},
{"digest":"287211846beea1eccb5f9acee00d20388a38fcb2e95858fa2332d6f58529379a","names":[],"sources":["packages/llm/llm/src/types.ts:165"]},
{"digest":"28936c614bd4e7e2774806edcbb3cbfd3ee643ac1cbf0bbdff43d915505a8fe3","names":[],"sources":[]},
{"digest":"290f32bfd81ff85a8095886a8066fae06e885942b63a8bcd6a8d66d328445808","names":[],"sources":[]},
@@ -196,7 +195,6 @@
{"digest":"2f1e6a7ebace43d727ae138ddcd352eb3813960009e5805b8c5ac84300c97716","names":["packages/attachment/attachment/src/types.ts#ImageMediaType"],"sources":["packages/attachment/attachment/src/types.ts:8"]},
{"digest":"2f3f201c8846e19c20bb75c02280e3d4eb3c57509e4715f0c0a4d1d4f91a7a06","names":[],"sources":[]},
{"digest":"2fe5026daf14bd4ff2b7bfb7cf9791c302d9cbba06802178b6dfec00b892698f","names":["packages/core/tool-executor-ptc/src/types.ts#PtcDispatchStartEventData"],"sources":["packages/core/tool-executor-ptc/src/types.ts:12"]},
{"digest":"300665af8bcc85dc20a65fd6681ee48d883178731c6f74457ed41539c607bc70","names":[],"sources":[]},
{"digest":"30d5a537b296685770b1241c4b4bbde19d5a31ff81aa23df73fab5e90b8fc65f","names":["packages/session/session-title/src/types.ts#SessionTitleSource"],"sources":["packages/session/session-title/src/types.ts:28"]},
{"digest":"312aee2f0c42aabbae6cc60d92d596d8453c0aeb061c5868d1755a69ef49e69a","names":[],"sources":[]},
{"digest":"31907de9563751822af6d9be02bafaf26faa098bbd1cb412524134d577cc1648","names":["packages/compaction/compaction/src/checkpoint.ts#CompactionCheckpointSource"],"sources":["packages/compaction/compaction/src/checkpoint.ts:21"]},
@@ -217,12 +215,12 @@
{"digest":"383cf73ae4748e5beb281ae74857ba1ffb92ae01075b9fbf51af78b666007a8f","names":[],"sources":[]},
{"digest":"3860b4757d512a2869be833acb0faf834335b1b056bf3f83df5474dce95f8fa6","names":[],"sources":["packages/llm/llm/src/assistant-stream.ts:34"]},
{"digest":"390eed1028aba02774f14408647acec10ec5516e97d4f15ecde2b9989d5a69f2","names":["packages/feedback/message-feedback/src/types.ts#MessageFeedbackRating"],"sources":["packages/feedback/message-feedback/src/types.ts:17"]},
{"digest":"394ffa61d7dc84ebfd56ad772b59e47be136b95b9549ebf0b77a3bbebf4ce6cc","names":["packages/llm/llm/src/message.ts#MessageSource"],"sources":["packages/llm/llm/src/message.ts:135"]},
{"digest":"39cf2d3ff8bac81c62d49ac2ba38a095b18e80f3ad700819fa1f650a4e60197f","names":["packages/jobs/jobs/src/types.ts#JobToolCall"],"sources":["packages/jobs/jobs/src/types.ts:16"]},
{"digest":"39fe981d6583647fe76f121c43bd6eac1f1a0d6707297f0901b3078899f9ac92","names":[],"sources":[]},
{"digest":"3a34ff4c0c404f4b674b06d4d567953b4dee24c35dd72b03ee5b89553326bb3a","names":[],"sources":[]},
{"digest":"3b04790e08b35241ffa0d38f6d7e4f8788aa921341f6c0d7574a329397c59408","names":[],"sources":[]},
{"digest":"3b1be838223869fe0a08210db85bf773796ed3f2373ac16555dff227cade0c48","names":[],"sources":[]},
{"digest":"3b4f2c9ef2c1217eac596c7b070173cb7896e2fae09e729bc7c56c801e56bb29","names":[],"sources":[]},
{"digest":"3b64001bcf263052763f2669013e5e20f0a963760d02cf765b142ad1349188f7","names":["packages/llm/llm/src/message.ts#DeveloperMessage"],"sources":["packages/llm/llm/src/message.ts:156"]},
{"digest":"3bc287e765d58dc3a22672a0495a6cfd561220dd38fbaecef80aa95b96caed79","names":[],"sources":[]},
{"digest":"3bd652ebfa8726b3ce3937a4f1bd2759e02f86b3a08a20f9e41a8513656fbc5f","names":["packages/core/session/src/types.ts#OptionalSessionSeq"],"sources":["packages/core/session/src/types.ts:66"]},
{"digest":"3bdb8dc6989655b0d4ec361edafb8e2629bc263e1ea591819414fdafc1a413b3","names":[],"sources":[]},
@@ -246,7 +244,6 @@
{"digest":"44818000e56acb97afdb5045ce235eb55e3fb1ccabc9fc7d0750bb38f36a7f8e","names":[],"sources":[]},
{"digest":"44c8c77aa9aa100b0d74d2deee85474b29faa6eee0ac0f662f7abe9931ddd7f2","names":[],"sources":[]},
{"digest":"4513e088d43e6c68425be30451b9f961cc264fe7318ca62681c41d4d78615986","names":[],"sources":[]},
{"digest":"45e3a4c397121e1a2a455c990b4d45852111b64909ced474d41b9f977ac592a4","names":["packages/llm/llm/src/message.ts#Message"],"sources":["packages/llm/llm/src/message.ts:195"]},
{"digest":"45f005e6bbb7645248be792b715a74bc7fdf5a67f5381655d3a75dcc7aa2112e","names":[],"sources":[]},
{"digest":"45f2a07ea94573123b6ae14db787a40062dec3834f36d8be92c523d40ba28448","names":[],"sources":["packages/interaction/user-approval/src/types.ts:44"]},
{"digest":"477614bca595a9e7adb5a1870be446b9a8684f3ba8950259d6289f2d3b74f028","names":[],"sources":["packages/compaction/compaction-image-offload/src/projection.ts:25"]},
@@ -271,7 +268,6 @@
{"digest":"4e44c9118152f6829634bfd508e47669ab0497caffa380c94b4be91f9390d35d","names":[],"sources":[]},
{"digest":"4e887768586528565381dadbddee6cef555874148089f4579e0b4b1ad096fc9c","names":["packages/llm/llm/src/types.ts#TextBlock"],"sources":["packages/llm/llm/src/types.ts:69","packages/web/web-search-deepseek/src/provider.ts:67"]},
{"digest":"4edec1b770e8ec4ce1220bf42edc5ac46713a1b48d4caa778dcfc98bad1f28a3","names":[],"sources":[]},
{"digest":"4ee17e4219bd5fab6148ec0a8b3ec0fb939edb8f211374cf779bc8135ef9bed2","names":[],"sources":[]},
{"digest":"4f507598cf476214aa7646ce7841a7064a9dcb05d0a1eaaefaf79c2b738f160f","names":[],"sources":[]},
{"digest":"4f91f187baeabef5c7950c4780d31bbe39f3345dff591a6cf26ac7e135ac1cf4","names":[],"sources":["packages/context/session-reference/src/types.ts:18"]},
{"digest":"4fb59762612c3e3ac3a3bd4f84c9c148d3c3893bd422ba2b201cc039fabd49bc","names":[],"sources":[]},
@@ -283,8 +279,10 @@
{"digest":"52c6113cb0e53f345324bf84f01928bea5d5df57ee80bc0dd65407b8bc5a3734","names":[],"sources":[]},
{"digest":"5302e763151277614b97e77f00e3b326694c6c1247b916a20503c344dc970777","names":[],"sources":["packages/core/session/src/types.ts:387"]},
{"digest":"530da6c0267813bb4511af72883cc518834e624e3b3220a7062955fd57a788a6","names":["packages/core/session/src/types.ts#RequestHeaderReason"],"sources":["packages/core/session/src/types.ts:283"]},
{"digest":"53538b9e2b974a81f1248a4505482f8ab5c91bdf59b24cb3bd8e908bf8dd278e","names":[],"sources":[]},
{"digest":"53cf1704ae0709c7678bcf070c83c619fc48ca1b5c173b74cfa8702f22a8e492","names":[],"sources":[]},
{"digest":"54f9276a1617d7c12594722c89cfe864bcbe4517e9a6f9c98bab14f199a135e0","names":[],"sources":["packages/core/session/src/types.ts:367"]},
{"digest":"5509e694e7b11c54a7b7b1730ad09fd46986a1aeaa45a713a69b9247f5861efb","names":[],"sources":[]},
{"digest":"557e148d30b79ee48645850832b30c717d7c3b64641deb5d6133b8b4e91ee0b8","names":[],"sources":[]},
{"digest":"5654685d7557ec747e74887237065e626a5bdfa426ca43f7fbb0b6fee9b0916c","names":[],"sources":[]},
{"digest":"56b7c047694875a843ba020dfea3c8380d54ae4ff88ab349e72004dc21e07c23","names":[],"sources":["packages/core/session/src/types.ts:231"]},
@@ -310,6 +308,7 @@
{"digest":"5d17f27a1ef9f7026c0232714adf7573961536d75f3303ca97973975f5af170e","names":[],"sources":[]},
{"digest":"5d542ac7bdf13310c46e1a884dec9fb18ad8c6e153cff207e639cd7bf9d7e694","names":[],"sources":[]},
{"digest":"5d7a64ed6aac5551ebf998dc25e1e7b48a144769913f89702840180e61dc3995","names":[],"sources":[]},
{"digest":"5d8b5283839b93371885639068f7df86ab6d3134faf186456bdd4f4bdcb42260","names":[],"sources":[]},
{"digest":"5dd766ccd1702a1142ad8b4bd44f2242f8e8a6752669ad3de0a5d224329b1438","names":[],"sources":["packages/compaction/compaction/src/types.ts:82"]},
{"digest":"5e6db6e24948d4a853c71cb9fabd252ad051ce93d4672c1266cf837c1c17b84e","names":[],"sources":[]},
{"digest":"5ebce1317eacd2c148456627a09668e927ee15c204f0643f5ea76b46b54a2647","names":[],"sources":[]},
@@ -344,6 +343,7 @@
{"digest":"6bbe793f6a93dc8d50a4d4d3fbb6f8ed15650bcb7e151d28669628f7b7c3fc25","names":["packages/goal/goal/src/types.ts#GoalSnapshot"],"sources":["packages/goal/goal/src/types.ts:60"]},
{"digest":"6bc8e51124d0874bc89e1d0ceff381a9c3cd0fc240667d69f841ce4f60f65fe5","names":[],"sources":["packages/core/session/src/types.ts:342"]},
{"digest":"6c03546143cdf6ae88f1745ac98c5139efa1588d1415249bbc5f3104d32ab800","names":[],"sources":["packages/core/session/src/types.ts:200"]},
{"digest":"6c0f8aded45d4b3194ba7a67bab10ec31e401dfa976e84b392911b5a221b0f85","names":[],"sources":[]},
{"digest":"6c1cccb433ddc153facb380c7dda956237ba5c31f8a532a69142dc277890cc9b","names":[],"sources":[]},
{"digest":"6c5a37d42ebdb12db4410699259335f1e149e3a0260425684c00b153afc8990d","names":[],"sources":["packages/core/session/src/types.ts:201"]},
{"digest":"6ccb6bc423fb3952458abf9c1b1c3284208b7e660344b612cc55da773d61afe4","names":[],"sources":[]},
@@ -378,12 +378,12 @@
{"digest":"7b1ce60193fa8b69292e5843858d9cee7dc565dcb40d33c136e5d7e8b8d4296a","names":[],"sources":[]},
{"digest":"7c6129b6961cf4b2a030f36c78d2b0a5be38617651a9b81322e054ee512bee06","names":["packages/feedback/message-feedback/src/types.ts#MessageFeedbackDelete"],"sources":["packages/feedback/message-feedback/src/types.ts:46"]},
{"digest":"7c9f44e90a0058f4cc532ae20dad0c10afa6eba22e70a6c79fc79490bad64397","names":[],"sources":[]},
{"digest":"7ce6b3aae88d015451212bcc1fef9d4bb25ed03bc842b7f4609e3e9f40fb695b","names":["packages/llm/llm/src/message.ts#MessageSource"],"sources":["packages/llm/llm/src/message.ts:135"]},
{"digest":"7d226b9fd95b4ba213d4237c22e930a91c3c769c95ca7f92977b9d625ba13438","names":["packages/goal/goal/src/domain.ts#GoalChangeMeta"],"sources":["packages/goal/goal/src/domain.ts:44"]},
{"digest":"7d54a5a5e629e2e7783bfac72683bcc5e969e9f43426b9289826aaf294ff6344","names":["packages/feedback/command-feedback/src/types.ts#FeedbackRecord"],"sources":["packages/feedback/command-feedback/src/types.ts:27"]},
{"digest":"7d65acf0a3a43a8f445ce5d3320b42eca492739fc931b2a7516bfb8368dc2c68","names":["packages/llm/llm/src/types.ts#ContentBlockType"],"sources":["packages/llm/llm/src/types.ts:155"]},
{"digest":"7df62978a2b7de8540e714152297743e0a622209a46a5ac9513fc0fad73ca23b","names":[],"sources":[]},
{"digest":"7eaef7a763ba5b949b8464bc8add8980a3a5ab566014b69787aeba71e5dfe07b","names":[],"sources":[]},
{"digest":"7ee5a828196d9e4b1672f94f977e68f37125da4297c23029dd682823c09e12fd","names":[],"sources":[]},
{"digest":"7f13860ee89a2d35ce09f958e85a04566cd59cb1de1d73a9619a9b631961dc71","names":[],"sources":[]},
{"digest":"7f7fd5a6b0064f597534b29ff62ef26e786dffccf5e14f654a7d4fcea2c35f04","names":[],"sources":[]},
{"digest":"7f9365bae9fcb73e1e34061a1acfe0422c1a5fd351848cace9bebbe806f28462","names":["packages/workflow/tool-workflow/src/types.ts#ToolWorkflowRunEndData"],"sources":["packages/workflow/tool-workflow/src/types.ts:36"]},
@@ -426,6 +426,7 @@
{"digest":"8c1c4f72755a78ea163523a46565316e36e9b644382eb48e6635c71a6f412dd2","names":[],"sources":[]},
{"digest":"8c627d7a45fa406cea879a3922105e27ed4c3c7966e264afaf11ea7a330f2dd1","names":[],"sources":[]},
{"digest":"8cdd3fdd295cee53035de16a1b23411716f75e9f994fe9510cac5d7fef605c76","names":[],"sources":[]},
{"digest":"8e0a3b4e470f634cfea5b9c6351dd34d8c819ddedd41a4c30eecde2017c9fd69","names":["packages/session/session-title-llm/src/index.ts#SessionTitleLlmRequestEventData"],"sources":["packages/session/session-title-llm/src/index.ts:43"]},
{"digest":"8e31bb958e9b015e6f8407eaade32217068159e816f3cc99c3ad76eb889732e0","names":[],"sources":["packages/llm/llm/src/types.ts:167"]},
{"digest":"8e611bf46821e5003a1605a73560a6f56388295149d449dfe2142d5ec335f29c","names":["packages/llm/llm/src/types.ts#ToolAdditionBlock"],"sources":["packages/llm/llm/src/types.ts:122"]},
{"digest":"8e8155594e07812356b67d732196dda894b0f9c91a5969d51612cf490b0a016d","names":[],"sources":[]},
@@ -550,6 +551,7 @@
{"digest":"b815d7b91cdd9fc6ccc7dcba05cfc5ce1d55fab5fc0c0801803cd3630cedb602","names":[],"sources":[]},
{"digest":"b81e9de81a481b24e1e1f9adf038bfc59e57b4f35ce62f8f1e45284186f4f812","names":[],"sources":["packages/session/session-title/src/types.ts:30"]},
{"digest":"b8327af7ee5767952d1300cb4f03b7fc04197ae5ba275e13981c689ff7506172","names":["packages/goal/goal/src/types.ts#GoalPhase"],"sources":["packages/goal/goal/src/types.ts:45"]},
{"digest":"b8ed92a5ca59733f046ea3506d64c35c64044b6a084fd51daee4c6c72727d39f","names":[],"sources":["packages/sdk/server/src/server.ts:54"]},
{"digest":"b8fc636a2121df9d8423c242e03c9d23b7ab7c6fdce00e45746932c60b730f97","names":["packages/deliverables/tool-present/src/types.ts#PresentedFile"],"sources":["packages/deliverables/tool-present/src/types.ts:5"]},
{"digest":"b9305f0ea75ccd6a6061c27fde19f2ab85534f9f3c1a717b573b077ebae0f611","names":[],"sources":[]},
{"digest":"b978cff734e62143eb56c9125423ec275405eda969802d42aaf73ecb987d3b26","names":[],"sources":[]},
@@ -606,6 +608,8 @@
{"digest":"d63b8b8ffad9c02fd80c43a17df4f240c1fe8118ecca9de34f9d5871838ab5b9","names":[],"sources":[]},
{"digest":"d66e11dddf5dfa3c71547e2cbd7b0608824cd8d6243fc16f532017ff28e8fba5","names":[],"sources":[]},
{"digest":"d6e654b88b584fcdf290a56802b1730bc7b9847ae86baa4265ab7769eb48990c","names":[],"sources":[]},
{"digest":"d73dbb5105041633eb357c9df0f1ae7fbfc911b00250b8b3c84d81fe319c8ae7","names":["packages/llm/llm/src/message.ts#Message"],"sources":["packages/llm/llm/src/message.ts:195"]},
{"digest":"d7c6a501b0381f8ee4430880905bc335a8089ebc57b2a65c3507bee9473ee3c4","names":[],"sources":["packages/core/agent/src/types.ts:110"]},
{"digest":"d85590a5675c6e2fd8164e5792a6cceac714605b8ac228adae5ee668facb1490","names":[],"sources":[]},
{"digest":"d8a476d2c6fd30df6ec0e799f91716d1518c780d23b4121dce545abfcfb7c5a5","names":[],"sources":[]},
{"digest":"d9196086e41e4dd5c2ce87f5c25529c8112a1731d258cf0728747d41a9ee3241","names":[],"sources":[]},
@@ -662,7 +666,6 @@
{"digest":"ec8b5ff7c77ca6893ac7ba5a0c5b2aefeb52f12c64450b7359660c2a7e8a53d7","names":[],"sources":["packages/core/session/src/types.ts:238"]},
{"digest":"edbbfff1128099fda7b792c56330d2cb04debc9790988e66d1c3f4026e813e0e","names":[],"sources":[]},
{"digest":"edd37b1e4974af648633014435572089b1e8fb71910468a0767a7e28fdd22abf","names":[],"sources":[]},
{"digest":"ee4277d9b4c96ab0a024b3c65d294712b6721808c564162bce7f7feed40c139f","names":["packages/session/session-title-llm/src/index.ts#SessionTitleLlmRequestEventData"],"sources":["packages/session/session-title-llm/src/index.ts:43"]},
{"digest":"ee577a0cc18664c9daee50e9455153321155604f8f1817362f8f4a4b6fb9e1ad","names":[],"sources":[]},
{"digest":"eea687d437880bd5f55fb447a561112800ca34334c0724d9cecb98493059d9e4","names":["packages/schedule/schedule/src/types.ts#ScheduleCreateChange"],"sources":["packages/schedule/schedule/src/types.ts:199"]},
{"digest":"eefbea819caeeea91ccb02dfafc16c68dd7f961cf9c1b2be25a2084509cf5c5a","names":[],"sources":[]},
@@ -682,7 +685,6 @@
{"digest":"f4a66f654996c093aae700ea4c434ff2ee3569fea9c0e5813ccf6afdccabd163","names":[],"sources":[]},
{"digest":"f5520c1d261ca86ea03735799c311a0a9ede8babb588cf0a65422576d2ee0ad1","names":[],"sources":[]},
{"digest":"f56c5b59ca0161310c338d31dd16cf14287ccd602ff4181058df178c1c286d7f","names":["packages/context/session-reference/src/types.ts#SessionReferenceSource"],"sources":["packages/context/session-reference/src/types.ts:13"]},
{"digest":"f5d843edb0eeef61c9f5328599d5f92b61112b7710b0310b043196b15b390d64","names":[],"sources":[]},
{"digest":"f6329fb30c7ea8013e8975ca5e78284fb7685cc6bd620e8aa4e9a99bc81d45eb","names":[],"sources":[]},
{"digest":"f634871d1e18b1eb199497ac8ab72d3964f48d03fbf611dc7521a1970cf429d9","names":[],"sources":[]},
{"digest":"f6605d6c57933aeaaf10911b5fbd6c61e655baa181af7192d3240f49d255b90d","names":[],"sources":[]},
@@ -699,7 +701,6 @@
{"digest":"fab2bb09bc5e3b9db0685e8f5500b029af1a2b33e70bc703c1d5d0f596fbc1fd","names":["packages/sandbox/sandbox/src/index.ts#SandboxMode"],"sources":["packages/sandbox/sandbox/src/index.ts:38"]},
{"digest":"fab35c4520883c0d69e42d079c9f543fc5ac7a2d15b537b5572fcd99059c7018","names":[],"sources":[]},
{"digest":"fb5e0517050d2c6d40e5b8145db1f7c5ca7044d5d50fada6ff80e0b22c6ca973","names":[],"sources":[]},
{"digest":"fb6a6e338625067ac582f55dde412a583040cd738bb8fc6820cb0b941c59f05a","names":[],"sources":[]},
{"digest":"fb8b6a2e53cb9cf44c551176de0fb77d1ddc60037b99a891ff8a860b6d5c29a0","names":[],"sources":[]},
{"digest":"fbd2c74b346a1595b376139c587fadd23e4a21acc9c0abce342975b6cfc60986","names":[],"sources":[]},
{"digest":"fc351843b8ecbd05d739c4ca4fcd4bc7cfad6c0beacbbd48389959bb1bf06cf3","names":[],"sources":[]},
@@ -712,9 +713,9 @@
{"digest":"fee1caf8ab6a65c1bc981f5a1730164490f22a2a89ffa3d0b76f1f432c44c8b5","names":[],"sources":[]}
],
"nodes": {
"010783c095f1d9bd": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"589d0d91239681f8","optional":false},{"name":"source","type":"394ffa61d7dc84eb","optional":false,"compatibility":{"version":1,"policy":"session-source-attribution","binding":"session.developer-message.source","discriminator":"kind","unknownKinds":"preserve","attributionKinds":["action-cards","tmux-context","user-question-reply","working-directory"]}}],"indices":[]},
"0116b1f89c05221d": {"kind":"literal","value":"web_search_20250305"},
"0203243b72fc867a": {"kind":"object","properties":[{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"02193e4f882eee79": {"kind":"array","element":"d73dbb5105041633"},
"022623b9ef98ec47": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false}],"indices":[]},
"023a355b2be0d688": {"kind":"object","properties":[{"name":"kind","type":"254dce209e735f9c","optional":false}],"indices":[]},
"025f11632cd02aae": {"kind":"object","properties":[{"name":"data","type":"da60ed58a8fa23d7","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"5f22f22ce033e6ce","optional":false}],"indices":[]},
@@ -734,7 +735,6 @@
"0a92c5bdfa06c2e2": {"kind":"object","properties":[{"name":"displayName","type":"4cd48f3e5108bd6e","optional":true},{"name":"providerId","type":"4cd48f3e5108bd6e","optional":false},{"name":"subjectId","type":"4cd48f3e5108bd6e","optional":false},{"name":"tenantId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"0aa62ab51b36c0e6": {"kind":"object","properties":[],"indices":[{"key":"4cd48f3e5108bd6e","value":"bbc5696e3f13c758"}]},
"0acd94fe8794574c": {"kind":"object","properties":[{"name":"blocks","type":"b1664fa89f8eab49","optional":true},{"name":"response","type":"bbc5696e3f13c758","optional":false}],"indices":[]},
"0aed9f5c80e82b6e": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"68f44f59e91c4139","optional":false},{"name":"source","type":"394ffa61d7dc84eb","optional":false,"compatibility":{"version":1,"policy":"session-source-attribution","binding":"session.user-message.source","discriminator":"kind","unknownKinds":"preserve","attributionKinds":["action-cards","tmux-context","user-question-reply","working-directory"]}}],"indices":[]},
"0af3ecfb8c60d416": {"kind":"literal","value":"turn/start"},
"0b6d718c693fdf7f": {"kind":"object","properties":[{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"revision","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"0b9b8facbe2c1977": {"kind":"literal","value":"disabled"},
@@ -755,8 +755,8 @@
"11638dc58a31496f": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"119abe2b9c0b2f46": {"kind":"object","properties":[{"name":"dialect","type":"a6b41f5bede8094d","optional":false},{"name":"handlerId","type":"4cd48f3e5108bd6e","optional":false},{"name":"matcher","type":"4cd48f3e5108bd6e","optional":true},{"name":"point","type":"4cd48f3e5108bd6e","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"11f70b595aa76897": {"kind":"object","properties":[{"name":"policy","type":"05d2ae1e0c7f8770","optional":false},{"name":"source","type":"76632533f67879dc","optional":true}],"indices":[]},
"120eda1d93010166": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"68f44f59e91c4139","optional":false},{"name":"source","type":"7ce6b3aae88d0154","optional":false,"compatibility":{"version":1,"policy":"session-source-attribution","binding":"session.user-message.source","discriminator":"kind","unknownKinds":"preserve","attributionKinds":["action-cards","tmux-context","user-question-reply","working-directory"]}}],"indices":[]},
"124aa62078ca3311": {"kind":"object","properties":[{"name":"data","type":"da60ed58a8fa23d7","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"d4c799e3d51cae10","optional":false}],"indices":[]},
"129f610271310df6": {"kind":"object","properties":[{"name":"headerSeq","type":"0657d3ca5ac4e7bf","optional":true},{"name":"message","type":"010783c095f1d9bd","optional":false},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"12a0cfa619ac4a5f": {"kind":"literal","value":"read-only"},
"12d5808fac1996b9": {"kind":"object","properties":[{"name":"attachment","type":"b0b0eb1b16490f6b","optional":false},{"name":"offloaded","type":"dacf3d5f3e4ff619","optional":true},{"name":"type","type":"fb8b6a2e53cb9cf4","optional":false}],"indices":[]},
"1379f0b72275994d": {"kind":"literal","value":"developer/message"},
@@ -815,11 +815,11 @@
"24ce31aa528272e5": {"kind":"object","properties":[{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"254dce209e735f9c": {"kind":"literal","value":"blocked"},
"260523b412c19ad8": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false}],"indices":[]},
"261128de68865c1f": {"kind":"object","properties":[{"name":"inserted","type":"300665af8bcc85dc","optional":false},{"name":"outcome","type":"d4e4d575abeb4b72","optional":true},{"name":"removedCount","type":"0657d3ca5ac4e7bf","optional":true},{"name":"start","type":"0657d3ca5ac4e7bf","optional":false},{"name":"target","type":"96f4a9c81fc0f940","optional":false}],"indices":[]},
"26718e15e7e395bc": {"kind":"object","properties":[{"name":"data","type":"11f70b595aa76897","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"36d6a9a871d949ea","optional":false}],"indices":[]},
"26c879bdd130e8b8": {"kind":"literal","value":"dispatch"},
"2765e9119edf5816": {"kind":"literal","value":"model"},
"277b61f9c6f81704": {"kind":"literal","value":"file"},
"27f8b01d8292dda6": {"kind":"object","properties":[{"name":"headerSeq","type":"0657d3ca5ac4e7bf","optional":true},{"name":"message","type":"3b64001bcf263052","optional":false},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"287211846beea1ec": {"kind":"object","properties":[{"name":"kind","type":"6c1cccb433ddc153","optional":false}],"indices":[]},
"28936c614bd4e7e2": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"290f32bfd81ff85a": {"kind":"object","properties":[{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
@@ -838,7 +838,6 @@
"2f1e6a7ebace43d7": {"kind":"union","types":["3f74ba74acd10644","58f94390b982f8a5","de30b1fa12c75f81","ebb768d85ec87fb6"]},
"2f3f201c8846e19c": {"kind":"literal","value":"tool-goal"},
"2fe5026daf14bd4f": {"kind":"object","properties":[{"name":"arguments","type":"bbc5696e3f13c758","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":false},{"name":"parentCallId","type":"4cd48f3e5108bd6e","optional":false},{"name":"rootCallId","type":"4cd48f3e5108bd6e","optional":false},{"name":"subCallId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"300665af8bcc85dc": {"kind":"array","element":"0aed9f5c80e82b6e"},
"30d5a537b2966857": {"kind":"union","types":["1b5649238876e288","ada310bf0bdb8fed","b81e9de81a481b24"]},
"312aee2f0c42aabb": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"d9edf1862e4471d6","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"31907de956375182": {"kind":"object","properties":[{"name":"compactionId","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"6b23ed9ce1b397e6","optional":false},{"name":"sourceCommandId","type":"4cd48f3e5108bd6e","optional":true}],"indices":[]},
@@ -859,12 +858,12 @@
"383cf73ae4748e5b": {"kind":"literal","value":"recall"},
"3860b4757d512a28": {"kind":"object","properties":[{"name":"args","type":"93c33d9687613293","optional":false},{"name":"dt","type":"5d03ba38734809bc","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"index","type":"0657d3ca5ac4e7bf","optional":false},{"name":"name","type":"4cd48f3e5108bd6e","optional":true},{"name":"time0","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"616f93a5047de668","optional":false}],"indices":[]},
"390eed1028aba027": {"kind":"union","types":["b1f62380f6746fed","df5d9709b7db2a72"]},
"394ffa61d7dc84eb": {"kind":"union","types":["0203243b72fc867a","022623b9ef98ec47","02b2c23f2d94b028","0ed8d1108fe7a5e1","0eeb17e1df89b1eb","11638dc58a31496f","1938c8c20f1cba7c","1e709346005826eb","1fdad624334d3548","2152caf1a71e588e","2235d957bf4b7c6c","224aa11d4d5f88c4","24ce31aa528272e5","260523b412c19ad8","28936c614bd4e7e2","290f32bfd81ff85a","297fbd8067d7815a","2aad1179f9576314","312aee2f0c42aabb","31907de956375182","3247e566f4340029","3b04790e08b35241","3b4f2c9ef2c1217e","3bdb8dc6989655b0","408927267422a7b2","45f005e6bbb76452","4991dfc415c9efeb","49dab019d00e8c26","4a9bef9f27a94252","52c6113cb0e53f34","53cf1704ae0709c7","5654685d7557ec74","58015da1c1950a66","5bb69b88517f6214","5bc66269cfaf614c","5cdbf342b7748d15","5d7a64ed6aac5551","6085488d223aeffd","6292bcbedaa97fea","65a8400e451e667e","65d583e66518c523","672c4aa2a9b736e3","6ccb6bc423fb3952","6ea608bdc8a7a63d","6f22a9d02b9a1f11","6f44f32be9bcd9a8","719c51f67074f970","7554565be416b034","756b5e23a5cb2c7f","7df62978a2b7de85","7eaef7a763ba5b94","7f959241c24128b4","80677c8c8b804189","825ca23416b1ea9d","8338ee303e2bd448","848639f8787f035b","854db3efdfb0cd39","85fe96bf15d5c755","8620189c8e335827","87b1a33564b9a4d6","88841202942c7683","8a046b52331959aa","8c1c4f72755a78ea","8c627d7a45fa406c","8f1062573ea91841","8f324cea3916c051","8fcb0b44a575e998","96bfb916a727cd44","99135d8a39379779","99f0e98184709ad1","9edc162949abf93b","9f65c43e340bba31","a15a19ef63cf5d1b","a16e567c8cd2c55c","a2066bd52f61218b","a3c6f1ea38e9a61d","a4afec59b75aad5d","aa2bf9e82b9fdeb9","aae343bc3d663c83","ada310bf0bdb8fed","ade057f4fdc387ae","b062078e899958f9","b2a5c8c008a31e3d","b3681c026a0b98e9","b4ec0af39fd52ed9","b613f83572fe2fbf","b6f94c17dd9bbd7c","b70f3e81fe11b7a5","b79641a9d25e7566","ba2a1a8f194b1bb2","ba4c40b4381e0dcd","baccc97ec34be6c4","c5228b7a55498d84","c55827fba7018198","cb1c8959e1726f82","cda2345a9be9d139","d215701afb7aafbf","d85590a5675c6e2f","d9c462b9f62fdd3e","db06ef35b27a3842","dba54c09c6e7aafc","dd00cdccd0ba487b","dd5ee8762bd8a14b","dd6cc2bb2a8f2824","dde0cdf9d426768b","deaae5cd30987d4f","e7f4cbb3a57f4cbd","edbbfff1128099fd","ee577a0cc18664c9","f230c0b583e23b25","f29d63336e8266d8","f4a66f654996c093","f56c5b59ca016131","f6329fb30c7ea801","f6605d6c57933aea","f6afe41e3926f422","f7283223aacdc39b","f97f47b0eb87905e","fcf81d3c58c13593","fe1a7acdeed4d0f5"]},
"39cf2d3ff8bac81c": {"kind":"object","properties":[{"name":"callId","type":"4cd48f3e5108bd6e","optional":false},{"name":"rootCallId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"39fe981d6583647f": {"kind":"array","element":"45e3a4c397121e1a"},
"3a34ff4c0c404f4b": {"kind":"object","properties":[{"name":"data","type":"120eda1d93010166","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"de25352d2dc41963","optional":false}],"indices":[]},
"3b04790e08b35241": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"3b1be838223869fe": {"kind":"object","properties":[{"name":"data","type":"e4c18e294232c3ba","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"c589e938cc0e4989","optional":false}],"indices":[]},
"3b4f2c9ef2c1217e": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"bb94f3217aa56c88","optional":false}],"indices":[]},
"3b64001bcf263052": {"kind":"object","properties":[{"name":"content","type":"b52f215a6cd69105","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"role","type":"589d0d91239681f8","optional":false},{"name":"source","type":"7ce6b3aae88d0154","optional":false,"compatibility":{"version":1,"policy":"session-source-attribution","binding":"session.developer-message.source","discriminator":"kind","unknownKinds":"preserve","attributionKinds":["action-cards","tmux-context","user-question-reply","working-directory"]}}],"indices":[]},
"3bc287e765d58dc3": {"kind":"literal","value":"normal"},
"3bd652ebfa8726b3": {"kind":"union","types":["0657d3ca5ac4e7bf","938f7c7357bc403e"]},
"3bdb8dc6989655b0": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
@@ -888,7 +887,6 @@
"44818000e56acb97": {"kind":"literal","value":"feedback/message-delete"},
"44c8c77aa9aa100b": {"kind":"literal","value":"subagent/catalog"},
"4513e088d43e6c68": {"kind":"object","properties":[{"name":"data","type":"ef11a3b7fa2033ae","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"2c64d4bc7264fd3f","optional":false}],"indices":[]},
"45e3a4c397121e1a": {"kind":"union","types":["010783c095f1d9bd","09f3f8dc417f2782","0aed9f5c80e82b6e","4b259f7f8f0a44ad","fa87537f4a9c1e25"]},
"45f005e6bbb76452": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"05205074b24d8340","optional":false},{"name":"through","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"45f2a07ea9457312": {"kind":"object","properties":[{"name":"callId","type":"4cd48f3e5108bd6e","optional":true},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"reason","type":"4cd48f3e5108bd6e","optional":true},{"name":"toolName","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"477614bca595a9e7": {"kind":"object","properties":[{"name":"targets","type":"9e2c06d8653585b3","optional":false}],"indices":[]},
@@ -913,7 +911,6 @@
"4e44c9118152f682": {"kind":"literal","value":"text"},
"4e88776858652856": {"kind":"object","properties":[{"name":"text","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"4e44c9118152f682","optional":false}],"indices":[]},
"4edec1b770e8ec4c": {"kind":"literal","value":"ptc-mode"},
"4ee17e4219bd5fab": {"kind":"object","properties":[{"name":"data","type":"ee4277d9b4c96ab0","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"587bb11da730e06a","optional":false}],"indices":[]},
"4f507598cf476214": {"kind":"literal","value":"series"},
"4f91f187baeabef5": {"kind":"object","properties":[{"name":"capturedFormatVersion","type":"0657d3ca5ac4e7bf","optional":true},{"name":"capturedThroughSeq","type":"3bd652ebfa8726b3","optional":false},{"name":"compacted","type":"aa93010d0e521ad7","optional":false},{"name":"inputIndex","type":"0657d3ca5ac4e7bf","optional":false},{"name":"label","type":"4cd48f3e5108bd6e","optional":false},{"name":"omittedBytes","type":"0657d3ca5ac4e7bf","optional":false},{"name":"omittedMessages","type":"0657d3ca5ac4e7bf","optional":false},{"name":"originalMessages","type":"0657d3ca5ac4e7bf","optional":false},{"name":"retainedMessages","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sessionId","type":"4cd48f3e5108bd6e","optional":false},{"name":"truncated","type":"aa93010d0e521ad7","optional":false}],"indices":[]},
"4fb59762612c3e3a": {"kind":"object","properties":[{"name":"data","type":"b1ebd5cda47d90d9","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"18fcdd273a2f2f9d","optional":false}],"indices":[]},
@@ -925,8 +922,10 @@
"52c6113cb0e53f34": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"5302e76315127761": {"kind":"object","properties":[{"name":"error","type":"a81059ca06999da1","optional":true},{"name":"message","type":"4b259f7f8f0a44ad","optional":false},{"name":"meta","type":"c592ce75aab73fca","optional":true},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"530da6c0267813bb": {"kind":"union","types":["34d1ab5c5df37818","4f507598cf476214","e7ce49f12953583f","f789af5ab844827e"]},
"53538b9e2b974a81": {"kind":"object","properties":[{"name":"data","type":"27f8b01d8292dda6","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"1379f0b72275994d","optional":false}],"indices":[]},
"53cf1704ae0709c7": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"99e7e7d7fed55ae6","optional":false}],"indices":[]},
"54f9276a1617d7c1": {"kind":"object","properties":[{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"stream","type":"84bbfdce7d2eab5b","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"5509e694e7b11c54": {"kind":"object","properties":[{"name":"data","type":"d7c6a501b0381f8e","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"829a2fb3be6efd4b","optional":false}],"indices":[]},
"557e148d30b79ee4": {"kind":"literal","value":"agent-preset/selected"},
"5654685d7557ec74": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"56b7c047694875a8": {"kind":"object","properties":[{"name":"kind","type":"69d238a6e9b08d67","optional":false}],"indices":[]},
@@ -952,6 +951,7 @@
"5d17f27a1ef9f702": {"kind":"literal","value":"tool-workflow/agent-end"},
"5d542ac7bdf13310": {"kind":"object","properties":[{"name":"childCreatedAt","type":"0657d3ca5ac4e7bf","optional":false},{"name":"childId","type":"4cd48f3e5108bd6e","optional":false},{"name":"label","type":"4cd48f3e5108bd6e","optional":true},{"name":"mode","type":"d28765f87d6b6ab4","optional":false},{"name":"version","type":"93d38436347f67c9","optional":false}],"indices":[]},
"5d7a64ed6aac5551": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false}],"indices":[]},
"5d8b5283839b9337": {"kind":"object","properties":[{"name":"data","type":"8e0a3b4e470f634c","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"587bb11da730e06a","optional":false}],"indices":[]},
"5dd766ccd1702a11": {"kind":"object","properties":[{"name":"shadowedRange","type":"9e41386b3a0c9572","optional":false},{"name":"shadowedSeqs","type":"5d03ba38734809bc","optional":false},{"name":"shadowedTokenCount","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"5e6db6e24948d4a8": {"kind":"object","properties":[{"name":"data","type":"17d1afb770d99419","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"1c2686c0682e7bc5","optional":false}],"indices":[]},
"5ebce1317eacd2c1": {"kind":"literal","value":"subagent/descriptor"},
@@ -986,6 +986,7 @@
"6bbe793f6a93dc8d": {"kind":"object","properties":[{"name":"blockedReason","type":"84ac8c1a66ffc697","optional":true},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"maxGoalRounds","type":"0657d3ca5ac4e7bf","optional":false},{"name":"objective","type":"4cd48f3e5108bd6e","optional":false},{"name":"phase","type":"b8327af7ee576795","optional":false},{"name":"revision","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"6bc8e51124d0874b": {"kind":"object","properties":[{"name":"message","type":"09f3f8dc417f2782","optional":false},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
"6c03546143cdf6ae": {"kind":"object","properties":[{"name":"kind","type":"e6411b09c1d982f7","optional":false}],"indices":[]},
"6c0f8aded45d4b31": {"kind":"array","element":"120eda1d93010166"},
"6c1cccb433ddc153": {"kind":"literal","value":"tool-calls"},
"6c5a37d42ebdb12d": {"kind":"object","properties":[{"name":"kind","type":"dbdafceb9a900183","optional":false},{"name":"reason","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"6ccb6bc423fb3952": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"f68c335306535a00","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
@@ -1020,12 +1021,12 @@
"7b1ce60193fa8b69": {"kind":"literal","value":"working-directory"},
"7c6129b6961cf4b2": {"kind":"object","properties":[{"name":"messageId","type":"4cd48f3e5108bd6e","optional":false},{"name":"sessionId","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"7c9f44e90a0058f4": {"kind":"object","properties":[{"name":"data","type":"5302e76315127761","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"570e850224346133","optional":false}],"indices":[]},
"7ce6b3aae88d0154": {"kind":"union","types":["0203243b72fc867a","022623b9ef98ec47","02b2c23f2d94b028","0ed8d1108fe7a5e1","0eeb17e1df89b1eb","11638dc58a31496f","1938c8c20f1cba7c","1e709346005826eb","1fdad624334d3548","2152caf1a71e588e","2235d957bf4b7c6c","224aa11d4d5f88c4","24ce31aa528272e5","260523b412c19ad8","28936c614bd4e7e2","290f32bfd81ff85a","297fbd8067d7815a","2aad1179f9576314","312aee2f0c42aabb","31907de956375182","3247e566f4340029","3b04790e08b35241","3b4f2c9ef2c1217e","3bdb8dc6989655b0","408927267422a7b2","45f005e6bbb76452","4991dfc415c9efeb","49dab019d00e8c26","4a9bef9f27a94252","52c6113cb0e53f34","53cf1704ae0709c7","5654685d7557ec74","58015da1c1950a66","5bb69b88517f6214","5bc66269cfaf614c","5cdbf342b7748d15","5d7a64ed6aac5551","6085488d223aeffd","6292bcbedaa97fea","65a8400e451e667e","65d583e66518c523","672c4aa2a9b736e3","6ccb6bc423fb3952","6ea608bdc8a7a63d","6f22a9d02b9a1f11","6f44f32be9bcd9a8","719c51f67074f970","7554565be416b034","756b5e23a5cb2c7f","7df62978a2b7de85","7eaef7a763ba5b94","7f959241c24128b4","80677c8c8b804189","825ca23416b1ea9d","8338ee303e2bd448","848639f8787f035b","854db3efdfb0cd39","85fe96bf15d5c755","8620189c8e335827","87b1a33564b9a4d6","88841202942c7683","8a046b52331959aa","8c1c4f72755a78ea","8c627d7a45fa406c","8f1062573ea91841","8f324cea3916c051","8fcb0b44a575e998","96bfb916a727cd44","99135d8a39379779","99f0e98184709ad1","9edc162949abf93b","9f65c43e340bba31","a15a19ef63cf5d1b","a16e567c8cd2c55c","a2066bd52f61218b","a3c6f1ea38e9a61d","a4afec59b75aad5d","aa2bf9e82b9fdeb9","aae343bc3d663c83","ada310bf0bdb8fed","ade057f4fdc387ae","b062078e899958f9","b2a5c8c008a31e3d","b3681c026a0b98e9","b4ec0af39fd52ed9","b613f83572fe2fbf","b6f94c17dd9bbd7c","b70f3e81fe11b7a5","b79641a9d25e7566","b8ed92a5ca59733f","ba2a1a8f194b1bb2","ba4c40b4381e0dcd","baccc97ec34be6c4","c5228b7a55498d84","c55827fba7018198","cb1c8959e1726f82","cda2345a9be9d139","d215701afb7aafbf","d85590a5675c6e2f","d9c462b9f62fdd3e","db06ef35b27a3842","dba54c09c6e7aafc","dd00cdccd0ba487b","dd5ee8762bd8a14b","dd6cc2bb2a8f2824","dde0cdf9d426768b","deaae5cd30987d4f","e7f4cbb3a57f4cbd","edbbfff1128099fd","ee577a0cc18664c9","f230c0b583e23b25","f29d63336e8266d8","f4a66f654996c093","f56c5b59ca016131","f6329fb30c7ea801","f6605d6c57933aea","f6afe41e3926f422","f7283223aacdc39b","f97f47b0eb87905e","fcf81d3c58c13593","fe1a7acdeed4d0f5"]},
"7d226b9fd95b4ba2": {"kind":"union","types":["1df34a6c086866ff","cffcdc19881ab61e"]},
"7d54a5a5e629e2e7": {"kind":"object","properties":[{"name":"category","type":"3305a4bb6b6c29b4","optional":true},{"name":"text","type":"4cd48f3e5108bd6e","optional":true}],"indices":[]},
"7d65acf0a3a43a8f": {"kind":"union","types":["1f0133217eeeffd8","277b61f9c6f81704","3c2535ca0a2062f1","4e44c9118152f682","83d6916021eede8f","85f9b505b7bdff1f","fb8b6a2e53cb9cf4"]},
"7df62978a2b7de85": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"78a9be340090b735","optional":false}],"indices":[]},
"7eaef7a763ba5b94": {"kind":"object","properties":[{"name":"form","type":"16d0507cb94b4cfc","optional":false},{"name":"kind","type":"23af3759678a30de","optional":false}],"indices":[]},
"7ee5a828196d9e4b": {"kind":"object","properties":[{"name":"data","type":"129f610271310df6","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"1379f0b72275994d","optional":false}],"indices":[]},
"7f13860ee89a2d35": {"kind":"literal","value":"session-reference"},
"7f7fd5a6b0064f59": {"kind":"object","properties":[{"name":"data","type":"5dd766ccd1702a11","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"10e386801903f9d4","optional":false}],"indices":[]},
"7f9365bae9fcb73e": {"kind":"object","properties":[{"name":"runId","type":"4cd48f3e5108bd6e","optional":false},{"name":"stopReason","type":"8465ece5e9d9007c","optional":false}],"indices":[]},
@@ -1068,6 +1069,7 @@
"8c1c4f72755a78ea": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"8c627d7a45fa406c": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"2f3f201c8846e19c","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"8cdd3fdd295cee53": {"kind":"literal","value":"command/done"},
"8e0a3b4e470f634c": {"kind":"object","properties":[{"name":"maxTokens","type":"0657d3ca5ac4e7bf","optional":false},{"name":"messageSeqs","type":"5d03ba38734809bc","optional":false},{"name":"messages","type":"02193e4f882eee79","optional":false},{"name":"reasoningEffort","type":"4cd48f3e5108bd6e","optional":true},{"name":"route","type":"07e1a58c58b593f5","optional":false},{"name":"system","type":"4cd48f3e5108bd6e","optional":false},{"name":"titleProvider","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"8e31bb958e9b015e": {"kind":"object","properties":[{"name":"failure","type":"5f2117d1856a5ab4","optional":false},{"name":"kind","type":"1e0b0b66b6f0c53f","optional":false}],"indices":[]},
"8e611bf46821e500": {"kind":"object","properties":[{"name":"tool","type":"fcf427290c6213c2","optional":true},{"name":"toolName","type":"4cd48f3e5108bd6e","optional":false},{"name":"type","type":"85f9b505b7bdff1f","optional":false}],"indices":[]},
"8e8155594e078123": {"kind":"literal","value":"workspace/changes"},
@@ -1192,6 +1194,7 @@
"b815d7b91cdd9fc6": {"kind":"literal","value":"goal"},
"b81e9de81a481b24": {"kind":"object","properties":[{"name":"kind","type":"e31572180d6b28b7","optional":false},{"name":"model","type":"07e1a58c58b593f5","optional":true},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"b8327af7ee576795": {"kind":"union","types":["254dce209e735f9c","c43b119ce579b3e9","c8e6f48878cc2a2f","d9196086e41e4dd5"]},
"b8ed92a5ca59733f": {"kind":"object","properties":[{"name":"clientTimeZone","type":"4cd48f3e5108bd6e","optional":true},{"name":"kind","type":"68f44f59e91c4139","optional":false}],"indices":[]},
"b8fc636a2121df9d": {"kind":"object","properties":[{"name":"description","type":"4cd48f3e5108bd6e","optional":true},{"name":"path","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"b9305f0ea75ccd6a": {"kind":"literal","value":"hook/invoked"},
"b978cff734e62143": {"kind":"object","properties":[{"name":"data","type":"79ddc907312f97cf","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"af0750d32d97d47b","optional":false}],"indices":[]},
@@ -1248,6 +1251,8 @@
"d63b8b8ffad9c02f": {"kind":"object","properties":[{"name":"data","type":"8bb8c3751a6ce64b","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"47e5d84f1a93450a","optional":false}],"indices":[]},
"d66e11dddf5dfa3c": {"kind":"object","properties":[{"name":"data","type":"cef171adf021a186","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"fb5e0517050d2c6d","optional":false}],"indices":[]},
"d6e654b88b584fcd": {"kind":"literal","value":"fallback"},
"d73dbb5105041633": {"kind":"union","types":["09f3f8dc417f2782","120eda1d93010166","3b64001bcf263052","4b259f7f8f0a44ad","fa87537f4a9c1e25"]},
"d7c6a501b0381f8e": {"kind":"object","properties":[{"name":"inserted","type":"6c0f8aded45d4b31","optional":false},{"name":"outcome","type":"d4e4d575abeb4b72","optional":true},{"name":"removedCount","type":"0657d3ca5ac4e7bf","optional":true},{"name":"start","type":"0657d3ca5ac4e7bf","optional":false},{"name":"target","type":"96f4a9c81fc0f940","optional":false}],"indices":[]},
"d85590a5675c6e2f": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false}],"indices":[]},
"d8a476d2c6fd30df": {"kind":"literal","value":"team/mode"},
"d9196086e41e4dd5": {"kind":"literal","value":"complete"},
@@ -1304,7 +1309,6 @@
"ec8b5ff7c77ca689": {"kind":"object","properties":[{"name":"kind","type":"b2245a906e13aa94","optional":false}],"indices":[]},
"edbbfff1128099fd": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"a9059a81430b3207","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"edd37b1e4974af64": {"kind":"object","properties":[{"name":"data","type":"611d82d2dc50df70","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"347de3380f2da308","optional":false}],"indices":[]},
"ee4277d9b4c96ab0": {"kind":"object","properties":[{"name":"maxTokens","type":"0657d3ca5ac4e7bf","optional":false},{"name":"messageSeqs","type":"5d03ba38734809bc","optional":false},{"name":"messages","type":"39fe981d6583647f","optional":false},{"name":"reasoningEffort","type":"4cd48f3e5108bd6e","optional":true},{"name":"route","type":"07e1a58c58b593f5","optional":false},{"name":"system","type":"4cd48f3e5108bd6e","optional":false},{"name":"titleProvider","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"ee577a0cc18664c9": {"kind":"object","properties":[{"name":"form","type":"e8de0f457fed5b9f","optional":false},{"name":"kind","type":"8067b0d232c350f1","optional":false},{"name":"summary","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"eea687d437880bd5": {"kind":"object","properties":[{"name":"operation","type":"7624ca28c61ca0ea","optional":false},{"name":"schedule","type":"4b1e632e05776982","optional":false},{"name":"version","type":"f88f1b7b6bb733f6","optional":false}],"indices":[]},
"eefbea819caeeea9": {"kind":"literal","value":"block-end"},
@@ -1324,7 +1328,6 @@
"f4a66f654996c093": {"kind":"object","properties":[{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"f5520c1d261ca86e": {"kind":"object","properties":[{"name":"data","type":"e3056e0dda3a379e","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"24a8188c4d61b70a","optional":false}],"indices":[]},
"f56c5b59ca016131": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"7f13860ee89a2d35","optional":false},{"name":"references","type":"df843efd87c78cf8","optional":false},{"name":"version","type":"f88f1b7b6bb733f6","optional":false}],"indices":[]},
"f5d843edb0eeef61": {"kind":"object","properties":[{"name":"data","type":"261128de68865c1f","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"829a2fb3be6efd4b","optional":false}],"indices":[]},
"f6329fb30c7ea801": {"kind":"object","properties":[{"name":"form","type":"383cf73ae4748e5b","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
"f634871d1e18b1eb": {"kind":"literal","value":"plan/mode"},
"f6605d6c57933aea": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"9ac52f0f84fec2eb","optional":false}],"indices":[]},
@@ -1341,7 +1344,6 @@
"fab2bb09bc5e3b9d": {"kind":"union","types":["12a0cfa619ac4a5f","18fce9540bb20897","a3edd1efd1fef21b"]},
"fab35c4520883c0d": {"kind":"literal","value":"rejected"},
"fb5e0517050d2c6d": {"kind":"literal","value":"tool/ptc-dispatch"},
"fb6a6e338625067a": {"kind":"object","properties":[{"name":"data","type":"0aed9f5c80e82b6e","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceEventSeqs","type":"5d03ba38734809bc","optional":true},{"name":"surfaceOp","type":"335e242de1fcc17b","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"de25352d2dc41963","optional":false}],"indices":[]},
"fb8b6a2e53cb9cf4": {"kind":"literal","value":"image"},
"fbd2c74b346a1595": {"kind":"literal","value":"agent-instructions"},
"fc351843b8ecbd05": {"kind":"literal","value":"external"},
-10
View File
@@ -396,16 +396,6 @@ getListMetadata(session: Session): SessionListMetadata
*/
observeSession( sessionId: SessionId, options: SessionObservationOptions = {}, ): Promise<SessionObservation>
/**
* Inspect domain-owned state without attaching or resuming a cold Session.
* The getter runs synchronously after preparation and must not mutate or retain the Session.
* @param sessionId - logical Session identity.
* @param read - domain getter returning detached data.
* @param signal - preparation cancellation.
* @returns the getter's value at the current live or prepared cut.
*/
inspectSession<T>(sessionId: SessionId, read: (session: Session) => T, signal?: AbortSignal): Promise<T>
/**
* Search the live-preferred logical corpus and group by session.
* @param request - query text, metadata filters, page size, and cursor.
-10
View File
@@ -396,16 +396,6 @@ getListMetadata(session: Session): SessionListMetadata
*/
observeSession( sessionId: SessionId, options: SessionObservationOptions = {}, ): Promise<SessionObservation>
/**
* Inspect domain-owned state without attaching or resuming a cold Session.
* The getter runs synchronously after preparation and must not mutate or retain the Session.
* @param sessionId - logical Session identity.
* @param read - domain getter returning detached data.
* @param signal - preparation cancellation.
* @returns the getter's value at the current live or prepared cut.
*/
inspectSession<T>(sessionId: SessionId, read: (session: Session) => T, signal?: AbortSignal): Promise<T>
/**
* Search the live-preferred logical corpus and group by session.
* @param request - query text, metadata filters, page size, and cursor.
@@ -0,0 +1,16 @@
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.5/archive-worktrees-without-sandbox-policy/guide.md
/:
en: 3665b6ec3aca78ed
zh: 4e2107594f2c4586
/archive-cleanup-ignores-the-creator-s-sandbox-policy:
en: aabc06ab672bab22
zh: 992c04ed13078e9c
/archive-cleanup-ignores-the-creator-s-sandbox-policy/change:
en: 0f6f9f29a08acc7f
zh: 2961fe146e9ac840
/archive-cleanup-ignores-the-creator-s-sandbox-policy/migration:
en: 6e6a944e98c1475a
zh: edc32a22433870b3
@@ -0,0 +1,22 @@
---
kind: upgrade-guide
description: "Archive cleanup removes a checkout whose creator's sandbox policy is read-only, and runs its Git commands outside the sandbox."
---
# Archive cleanup ignores the creator's sandbox policy
English | [中文](guide.zh.md)
## Change
[v0.2.2-rc.1](../../v0.2.2-rc.1/archive-worktrees/guide.md) retained an archived Session's checkout while its creator's sandbox policy was read-only, and ran the removal's Git commands under that policy. Archiving now counts as the user's authorization to remove the checkout: cleanup reads no sandbox policy, removes the checkout whatever the creator's mode, and runs `git status` and `git worktree remove` outside the sandbox with the Host user's permissions. Git reads the repository's configuration as usual; hooks and the filesystem monitor stay disabled.
The checks that bound removal are unchanged: the checkout lies in the configured pool of its source checkout, is registered on its recorded branch without locks or a detached HEAD, and has no tracked changes, untracked files, or initialized submodules; no unarchived Session refers to it; the branch and its commits remain.
You are affected when you relied on a read-only creator to keep its checkout after archiving, or on the sandbox to confine cleanup.
## Migration
1. To keep every checkout on archive, set `retainOnArchive: true` on the worktree service, in `cordis.yml` or from the Forge panel's switch on the Plugins page.
2. To keep one checkout, leave a tracked change or an untracked file in it, or keep an unarchived Session working inside it, before archiving the creator.
3. Archive a test Session that created a clean worktree, then check `ctx.worktrees.cleanupOf(sessionId, null)`: `removed` confirms the new behavior, and `null` confirms `retainOnArchive` is in effect.
@@ -0,0 +1,22 @@
---
kind: upgrade-guide
description: "归档清理会删除创建者沙箱策略为只读的检出目录,且其 Git 命令不经沙箱执行。"
---
# 归档清理不再参考创建者的沙箱策略
[English](guide.md) | 中文
## 变更
[v0.2.2-rc.1](../../v0.2.2-rc.1/archive-worktrees/guide.zh.md) 中,创建者的沙箱策略为只读时会保留被归档 Session 的检出目录,删除用的 Git 命令也受该策略约束。现在归档即视为用户授权删除该目录:清理不读取任何沙箱策略,无论创建者是什么模式都会删除,`git status` 与 `git worktree remove` 以 Host 用户的权限在沙箱外执行。Git 照常读取仓库配置;hooks 与文件系统监视器仍然关闭。
约束删除的检查不变:目录位于源检出目录配置的池中,登记在记录的分支上,没有锁也不是 detached HEAD,没有已跟踪改动、未跟踪文件或已初始化的子模块;没有未归档 Session 引用它;分支及其提交保留。
依赖只读创建者在归档后保留检出目录、或依赖沙箱约束清理的用户会受影响。
## 迁移
1. 要在归档时保留所有检出目录,在 `cordis.yml` 中为 worktree 服务设置 `retainOnArchive: true`,或在插件页 Forge 面板的开关中打开。
2. 要保留某一个检出目录,在归档创建者之前让其中留有已跟踪改动或未跟踪文件,或让一个未归档 Session 在其中工作。
3. 归档一个创建过干净 worktree 的测试 Session,再查看 `ctx.worktrees.cleanupOf(sessionId, null)`:`removed` 表示新行为生效,`null` 表示 `retainOnArchive` 生效。
@@ -0,0 +1,16 @@
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.5/sdk-prompt-time-zone/guide.md
/:
en: a07259d8388d4cac
zh: 2e52c1c30028a099
/sdk-prompts-report-the-process-time-zone-by-default:
en: a05ff032b245d2a9
zh: 65a504c65b00ed4f
/sdk-prompts-report-the-process-time-zone-by-default/change:
en: 6f9aa3d02e634b47
zh: 9637bed97668d8d7
/sdk-prompts-report-the-process-time-zone-by-default/migration:
en: f39441fa05c7a2fd
zh: 9f125d2d0f293f47
@@ -0,0 +1,23 @@
---
kind: upgrade-guide
description: "SDK prompts without a time zone now report the runtime process zone to the model instead of an unavailable zone."
---
# SDK prompts report the process time zone by default
English | [中文](guide.zh.md)
## Change
In earlier releases, every SDK prompt reached the model with `Browser time zone for this request: unavailable.`, so the model asked the user to clarify unqualified dates and times. Now each ordinary prompt reports a zone, as Web prompts do: the `timeZone` passed with the prompt, or else the runtime process zone sampled for that prompt. The model then interprets unqualified dates and times in that zone, for example `Browser time zone for this request: UTC. Interpret otherwise-unqualified dates and times in this zone.`
This affects TypeScript and Python SDK applications, and direct JSON-RPC clients of `session/prompt` and `session/query`, that pass no zone. Containers usually run in `UTC`, which may not be the user's zone. A process zone that is not `UTC` or an IANA Area/Location name, such as `+00:00` under `TZ=GMT`, still reports `unavailable`. An explicit zone outside these formats now fails the request. Native slash commands are unchanged and record no zone.
## Migration
1. Pass the user's zone with each prompt when it differs from the runtime process zone:
- TypeScript: `session.run(input, { timeZone: 'Asia/Shanghai' })`, `harness.run(input, { timeZone })`, or `client.prompt(sessionId, blocks, { timeZone })`.
- Python: `session.run(input, time_zone="Asia/Shanghai")`, `harness.run(input, time_zone=...)`, or `client.session_prompt(session_id, blocks, time_zone=...)`.
- JSON-RPC: add `"timeZone": "Asia/Shanghai"` to `session/prompt` or `session/query` params.
2. Alternatively, when one runtime serves users in one zone, set `TZ` in the runtime environment, for example `TZ=Asia/Shanghai`.
3. Confirm with a prompt that asks for the current time: the model request contains `Browser time zone for this request: <your zone>.`, and a request with an invalid zone such as `CST` fails with a JSON-RPC error naming the value.
@@ -0,0 +1,23 @@
---
kind: upgrade-guide
description: "未指定时区的 SDK prompt 现在向模型上报运行时进程时区,而不再是时区不可用。"
---
# SDK prompt 默认上报进程时区
[English](guide.md) | 中文
## 变更
在早期版本中,每条 SDK prompt 送达模型时都带有 `Browser time zone for this request: unavailable.`,因此模型会请用户澄清未限定时区的日期与时间。现在每条普通 prompt 都像 Web prompt 一样上报时区:使用随 prompt 传入的 `timeZone`,否则使用运行时为这条 prompt 采样的进程时区。模型随后按该时区解释未限定的日期与时间,例如 `Browser time zone for this request: UTC. Interpret otherwise-unqualified dates and times in this zone.`。
受影响的是不传时区的 TypeScript 与 Python SDK 应用,以及直接调用 `session/prompt` 和 `session/query` 的 JSON-RPC 客户端。容器通常运行在 `UTC`,它可能不是用户的时区。进程时区既不是 `UTC` 也不是 IANA Area/Location 名称时(例如 `TZ=GMT` 下的 `+00:00`),仍上报 `unavailable`。不符合这些格式的显式时区现在会让请求失败。原生 slash 命令不变,不记录时区。
## 迁移
1. 用户时区与运行时进程时区不同时,为每条 prompt 传入用户时区:
- TypeScript:`session.run(input, { timeZone: 'Asia/Shanghai' })`、`harness.run(input, { timeZone })` 或 `client.prompt(sessionId, blocks, { timeZone })`。
- Python:`session.run(input, time_zone="Asia/Shanghai")`、`harness.run(input, time_zone=...)` 或 `client.session_prompt(session_id, blocks, time_zone=...)`。
- JSON-RPC:在 `session/prompt` 或 `session/query` 的 params 中加入 `"timeZone": "Asia/Shanghai"`。
2. 如果一个运行时只服务同一时区的用户,也可以在运行时环境中设置 `TZ`,例如 `TZ=Asia/Shanghai`。
3. 用一条询问当前时间的 prompt 确认:模型请求中包含 `Browser time zone for this request: <你的时区>.`;带非法时区(例如 `CST`)的请求以写明该值的 JSON-RPC 错误失败。
@@ -0,0 +1,16 @@
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.5/session-query-inspect-session-removed/guide.md
/:
en: dddfb5bf2fed957d
zh: e7af1103d0d94c43
/ctx-sessionquery-inspectsession-is-removed:
en: a53d9621aedeeab7
zh: 3ee8c33b78c7c717
/ctx-sessionquery-inspectsession-is-removed/change:
en: 6a2bc607cff3fce9
zh: 0b67af2e8a6c0122
/ctx-sessionquery-inspectsession-is-removed/migration:
en: 120cf3ce967ce942
zh: 93227b7e520e3678
@@ -0,0 +1,21 @@
---
kind: upgrade-guide
description: "ctx.sessionQuery.inspectSession is removed, so a plugin that reads a cold Session through a prepared Session object no longer compiles."
---
# `ctx.sessionQuery.inspectSession` is removed
English | [中文](guide.zh.md)
## Change
`SessionQueryEngine.inspectSession(sessionId, read, signal?)` from `@deepseek-ai/dsh-session-query` is removed. It prepared an unpublished `Session` for a cold Session and passed it to a synchronous getter, so projection handles and owner services could read it. That object was not in the Session store, had no Agent, and could not be appended to. The only in-repository caller, worktree archive cleanup, now reads projection wire values through `observeSession`.
A third-party plugin is affected when it calls `ctx.sessionQuery.inspectSession`; it fails to compile, and an untyped call rejects at run time.
## Migration
1. Search your plugin for `inspectSession(`.
2. Replace each call with an observation and read the projection's wire value by key: `using observation = await ctx.sessionQuery.observeSession(sessionId, { signal })`, then `observation.projections?.values[key]`. The value is computed to the end of the log for live and cold Sessions alike, without attaching or resuming a cold Session.
3. State without a wire view is private to its owner; read it through the owner's service, or ask the owner to add a wire view.
4. Run your typecheck; it passes once no call remains.
@@ -0,0 +1,21 @@
---
kind: upgrade-guide
description: "移除 ctx.sessionQuery.inspectSession,经预备 Session 对象读取冷会话的插件将无法通过编译。"
---
# 移除 `ctx.sessionQuery.inspectSession`
[English](guide.md) | 中文
## 变更
`@deepseek-ai/dsh-session-query` 的 `SessionQueryEngine.inspectSession(sessionId, read, signal?)` 已移除。它为冷会话准备一个未发布的 `Session`,交给同步读取函数,让投影句柄和属主服务可以读取。这个对象不在 Session 存储中,没有 Agent,也不能追加事件。仓库内唯一的调用方 worktree 归档清理,现在经 `observeSession` 读取投影的对外值。
调用 `ctx.sessionQuery.inspectSession` 的第三方插件会受影响:无法通过编译,未标类型的调用会在运行时被拒绝。
## 迁移
1. 在插件中搜索 `inspectSession(`。
2. 把每处调用改为观察会话,再按 key 读取投影的对外值:`using observation = await ctx.sessionQuery.observeSession(sessionId, { signal })`,然后读 `observation.projections?.values[key]`。活会话与冷会话的值都算到日志末尾,冷会话不会被挂载或恢复运行。
3. 没有对外视图的状态归属方私有;经属主的服务读取,或请属主补上对外视图。
4. 运行类型检查;不再有调用时即可通过。
+1
View File
@@ -245,6 +245,7 @@
"@deepseek-ai/dsh-experimental-computer-use-cua-driver-native": "workspace:*",
"@deepseek-ai/dsh-cua": "workspace:*",
"@deepseek-ai/dsh-experimental-claude-code-mods": "workspace:*",
"@deepseek-ai/dsh-feishu": "workspace:*",
"@deepseek-ai/dsh-llm-replay": "workspace:*",
"@deepseek-ai/dsh-subagent-dsh-sdk": "workspace:*",
"@deepseek-ai/dsh-llm": "workspace:*",
+1 -1
View File
@@ -352,7 +352,7 @@
Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed only to keep the request shape stable. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
+4 -4
View File
@@ -24,8 +24,8 @@
en: 4f88e647c6df4f42
zh: 2bd3e4b0bdfe9412
/deepseek-ai-dsh-sdk-app/model-experience/sdk-model-context/what-the-model-sees:
en: 8dad6328ef482cd8
zh: 29c9d3c97f30744d
en: 2c54cdab827df6dc
zh: 575a00d86ecea5aa
/deepseek-ai-dsh-sdk-app/model-experience/sdk-model-context/token-effect:
en: 7bb67dfbf1621d73
zh: 71414a307ccf3f7b
@@ -33,8 +33,8 @@
en: ccce9395f246ba39
zh: d758f8a78f03878d
/deepseek-ai-dsh-sdk-app/known-limitations-and-deferred-work:
en: d1d4567b7d2b9d8d
zh: c1618617d1562d8b
en: 9c42e75920483b74
zh: 0e9ff65a001a5919
/deepseek-ai-dsh-sdk-app/known-limitations-and-deferred-work/dev-note:
en: b9b4e27513ebba78
zh: 51b123ac60ff28c6
+2 -2
View File
@@ -48,7 +48,7 @@ The Python runtime exposes explicitly downloaded authoring resources and Office
#### What the model sees
The profile inherits the base system prompt, including the `You are an AI agent powered by DeepSeek Harness.` identity, and adds the same model-interpolated coding persona as the Web and headless profiles. Each Session receives its current directory in required user-role context from [`dsh-working-directory`](../../session/working-directory/README.md). Default file tool schemas include `read`, `write`, and `edit`; they omit `str_replace_editor`. The model also receives `present`, `ask_user_question`, `plugin_manager`, schedule tools, shared file-reference guidance, and time context. Child agents cannot use schedule tools. The [`time-context`](../../context/time-context/README.md) row accepts a fallback time zone. The skill catalog always lists the Office skills; their Python environment section names `load_workspace_dependencies` with an authoring payload and the user's existing Python without one. The catalog also lists `dsh-doc`, the DSH documentation skill that the Desktop standard, PTC, and Creator presets list; see the [Web app](../web-app/README.md#model-experience) for what it guides.
The profile inherits the base system prompt, including the `You are an AI agent powered by DeepSeek Harness.` identity, and adds the same model-interpolated coding persona as the Web and headless profiles. Each Session receives its current directory in required user-role context from [`dsh-working-directory`](../../session/working-directory/README.md). Default file tool schemas include `read`, `write`, and `edit`; they omit `str_replace_editor`. The model also receives `present`, `ask_user_question`, `plugin_manager`, schedule tools, shared file-reference guidance, and time context. Child agents cannot use schedule tools. The [`time-context`](../../context/time-context/README.md) row accepts a fallback time zone. Each ordinary prompt reports its zone like a Web prompt: the client's `timeZone` (`time_zone` in Python) when given, otherwise the runtime process zone sampled for that prompt, so the model sees `Browser time zone for this request: <zone>. Interpret otherwise-unqualified dates and times in this zone.` A process zone that is not UTC or an IANA Area/Location name, such as the `+00:00` that `TZ=GMT` produces, reports `unavailable`. The skill catalog always lists the Office skills; their Python environment section names `load_workspace_dependencies` with an authoring payload and the user's existing Python without one. The catalog also lists `dsh-doc`, the DSH documentation skill that the Desktop standard, PTC, and Creator presets list; see the [Web app](../web-app/README.md#model-experience) for what it guides.
#### Token effect
@@ -63,7 +63,7 @@ Enabling `plugin_manager` changes the tool-schema prefix from earlier SDK versio
<a id="known-limitations-and-deferred-work"></a>
- **No graphical client** — file cards, native file opening, and browser state require an embedding client; the SDK starts no Web server.
- **User time zone is unknown** — the SDK protocol does not carry a user time zone, so time context reports `Browser time zone for this request: unavailable.` The process or container time zone may differ from the user's. The `time-context.timeZone` setting only controls fallback timestamp formatting; it does not establish the user's time zone. Automatic detection and SDK time-zone input are deferred.
- **The process zone stands in for the user** — a prompt without `timeZone` reports the runtime process zone, which may differ from the user's; containers usually run in UTC. Pass the user's zone per prompt or set `TZ` for the runtime. The `time-context.timeZone` setting only controls fallback timestamp formatting; it does not establish the user's time zone. Native commands record no zone, matching Web commands, so a turn opened by `/plan <message>` reports `unavailable`.
- **Questions require an answerer** — configure `onUserQuestion` in TypeScript or `on_user_question` in Python, or supply a native `user-questions/request` handler; otherwise `ask_user_question` returns `NO_PROVIDER`.
- **Schedules share the runtime lifetime** — delivery needs a running process and its persistent Session storage.
- **A profile can omit the SDK server** — a custom profile selected by the TypeScript client must retain this bundle or another `dsh-sdk-jsonrpc-server` row; client initialization fails when no peer answers.
+2 -2
View File
@@ -48,7 +48,7 @@ Python 运行时向本 profile 提供显式下载的创作资源和 Office sidec
#### 模型看到什么
profile 继承 base 系统提示词,包括 `You are an AI agent powered by DeepSeek Harness.` 身份说明,并添加与 Web 和 headless profile 相同、按当前模型插值的 coding persona。每个 Session 通过 [`dsh-working-directory`](../../session/working-directory/README.zh.md) 提供的必需 user-role 上下文接收当前目录。默认文件工具 schema 包含 `read`、`write` 和 `edit`,不包含 `str_replace_editor`。模型还会收到 `present`、`ask_user_question`、`plugin_manager`、定时任务工具、共用文件引用说明和时间上下文。子 agent 不能使用定时任务工具。[`time-context`](../../context/time-context/README.zh.md) 配置项接受回退时区。技能目录总是列出 Office skills;有创作载荷时其 Python 环境说明指向 `load_workspace_dependencies`,没有时指向用户已有的 Python。技能目录还列出 `dsh-doc`,即 Desktop 标准模式、PTC 模式和创造模式列出的 DSH 文档 skill;其用途参见 [Web app](../web-app/README.zh.md#model-experience)。
profile 继承 base 系统提示词,包括 `You are an AI agent powered by DeepSeek Harness.` 身份说明,并添加与 Web 和 headless profile 相同、按当前模型插值的 coding persona。每个 Session 通过 [`dsh-working-directory`](../../session/working-directory/README.zh.md) 提供的必需 user-role 上下文接收当前目录。默认文件工具 schema 包含 `read`、`write` 和 `edit`,不包含 `str_replace_editor`。模型还会收到 `present`、`ask_user_question`、`plugin_manager`、定时任务工具、共用文件引用说明和时间上下文。子 agent 不能使用定时任务工具。[`time-context`](../../context/time-context/README.zh.md) 配置项接受回退时区。每条普通 prompt 像 Web prompt 一样上报时区:传入了客户端的 `timeZone`(Python 中为 `time_zone`)时用它,否则用运行时为这条 prompt 采样的进程时区,因此模型看到 `Browser time zone for this request: <zone>. Interpret otherwise-unqualified dates and times in this zone.`。进程时区既不是 UTC 也不是 IANA Area/Location 名称时(例如 `TZ=GMT` 产生的 `+00:00`),上报 `unavailable`。技能目录总是列出 Office skills;有创作载荷时其 Python 环境说明指向 `load_workspace_dependencies`,没有时指向用户已有的 Python。技能目录还列出 `dsh-doc`,即 Desktop 标准模式、PTC 模式和创造模式列出的 DSH 文档 skill;其用途参见 [Web app](../web-app/README.zh.md#model-experience)。
#### Token 影响
@@ -63,7 +63,7 @@ profile 继承 base 系统提示词,包括 `You are an AI agent powered by Dee
<a id="known-limitations-and-deferred-work"></a>
- **没有图形客户端**:文件卡片、本地文件打开和浏览器状态需要嵌入客户端;SDK 不启动 Web server。
- **用户时区未知**:SDK 协议不携带用户时区,因此时间上下文显示 `Browser time zone for this request: unavailable.`。进程或容器的时区可能与用户时区不同。`time-context.timeZone` 配置只控制回退时间戳的显示格式,不能据此确定用户时区。自动检测和 SDK 时区传参暂缓支持。
- **进程时区代替用户时区**:不带 `timeZone` 的 prompt 上报运行时进程时区,它可能与用户时区不同;容器通常运行在 UTC。请为每条 prompt 传入用户时区,或为运行时设置 `TZ`。`time-context.timeZone` 配置只控制回退时间戳的显示格式,不能据此确定用户时区。原生命令与 Web 命令一样不记录时区,因此由 `/plan <message>` 开启的轮次上报 `unavailable`。
- **提问需要回答方**:在 TypeScript 中配置 `onUserQuestion`、在 Python 中配置 `on_user_question`,或提供原生 `user-questions/request` handler;否则 `ask_user_question` 返回 `NO_PROVIDER`。
- **定时任务依赖运行时生命周期**:投递需要运行中的进程及其持久化 Session 存储。
- **profile 可能省略 SDK server**:TypeScript client 选择的自定义 profile 必须保留本组合包或另一个 `dsh-sdk-jsonrpc-server` 配置项;没有 peer 响应时,client 初始化会失败。
+2 -2
View File
@@ -15,8 +15,8 @@
en: 1eb35b015a6c423f
zh: a8a3dceee2c9e943
/connector-application-plugins/packages:
en: 19410c41d9654016
zh: 45055a4e031c5da1
en: e875a808081f87f4
zh: c39a1dd63498ffb1
/connector-application-plugins/related-documentation:
en: a8c37c85ac7dfaf1
zh: 9f894caf2f0322c2
+1
View File
@@ -25,6 +25,7 @@ Each application plugin in this group is installed into a profile to use one thi
| Package | Role | ctx key |
|---|---|---|
| [`cli-account/`](cli-account/README.md) | Holds the vendor CLIs and accounts CLI app plugins register: gives the model each CLI's absolute path in runtime context, runs each plugin's account operations one at a time, and shows the account on the Plugins page | `ctx.cliAccounts` |
| [`feishu/`](feishu/README.md) | The Feishu plugin: installs the official `lark-cli`, gives the model its absolute path, registers its embedded skills, and runs the account operations the Plugins page drives | registers on `ctx.cliAccounts` and `ctx.skills` |
| [`upstream-skills/`](upstream-skills/README.md) | Holds the entry skills CLI app plugins register: downloads the upstream files each entry indexes from a pinned commit of the vendor's GitHub repository, verifies and caches them, and lists the entry skill over them | `ctx.upstreamSkills` |
| [`linear/`](linear/README.md) | Registers Linear's hosted MCP server with OAuth through the shared MCP manager, adds the Linear plugin naming guidance, and shows its account on the plugin page | registers on `ctx.mcpManager`, `ctx.systemPrompt`, and `ctx.mcpAccounts` |
| [`notion/`](notion/README.md) | Registers Notion's hosted MCP server with OAuth through the shared MCP manager, adds the Notion plugin naming guidance, and shows its account on the plugin page | registers on `ctx.mcpManager`, `ctx.systemPrompt`, and `ctx.mcpAccounts` |
+1
View File
@@ -25,6 +25,7 @@ kind: "package-group"
| 包 | 职责 | ctx 键 |
|---|---|---|
| [`cli-account/`](cli-account/README.zh.md) | 保存 CLI 应用插件注册的厂商 CLI 和账号:在运行时上下文中把每个 CLI 的绝对路径告诉模型,让每个插件的账号操作一次只执行一个,并在插件页显示账号 | `ctx.cliAccounts` |
| [`feishu/`](feishu/README.zh.md) | 飞书插件:安装官方 `lark-cli`,把它的绝对路径告诉模型,注册其内嵌 skill,并执行插件页发起的账号操作 | 注册到 `ctx.cliAccounts` 与 `ctx.skills` |
| [`upstream-skills/`](upstream-skills/README.zh.md) | 保存 CLI 应用插件注册的入口技能:从厂商 GitHub 仓库的固定提交下载每个入口索引的上游文件,校验并缓存,再在这些文件之上列出入口技能 | `ctx.upstreamSkills` |
| [`linear/`](linear/README.zh.md) | 通过共用的 MCP 管理器以 OAuth 注册 Linear 托管的 MCP 服务器,添加 Linear 插件称呼指引,并在插件页面显示账号 | 注册到 `ctx.mcpManager`、`ctx.systemPrompt` 与 `ctx.mcpAccounts` |
| [`notion/`](notion/README.zh.md) | 通过共用的 MCP 管理器以 OAuth 注册 Notion 托管的 MCP 服务器,添加 Notion 插件称呼指引,并在插件页面显示账号 | 注册到 `ctx.mcpManager`、`ctx.systemPrompt` 与 `ctx.mcpAccounts` |
@@ -0,0 +1,91 @@
# Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/connector/feishu/README.md
/:
en: 2264374cd0367ea0
zh: 44bbf2e3b393d790
/deepseek-ai-dsh-feishu:
en: 5b26d6ad2128b454
zh: 6d3ccfcdb716ef8d
/deepseek-ai-dsh-feishu/summary:
en: a07d30fd633d14b8
zh: d78e326c5edcde47
/deepseek-ai-dsh-feishu/table-of-contents:
en: d152484eb41ac6b4
zh: 09388d293f9be9cb
/deepseek-ai-dsh-feishu/use-this-package:
en: bbff250eba0f1b89
zh: 0a618f05cc88ee2b
/deepseek-ai-dsh-feishu/use-this-package/install-into-a-profile:
en: 756d8e3c33815f24
zh: 7f6a3fcfef92c6b8
/deepseek-ai-dsh-feishu/use-this-package/what-you-get:
en: 55d9fdc4ef0be522
zh: 8063b8baa6c42776
/deepseek-ai-dsh-feishu/use-this-package/account-operations:
en: 4b5f07c32cac8141
zh: 473a23f50efa5947
/deepseek-ai-dsh-feishu/use-this-package/configure:
en: 7791974428fc09cb
zh: 62bb720d2b4842be
/deepseek-ai-dsh-feishu/understand-the-implementation:
en: f8f0f9cb9eb55960
zh: 05f09e2198565082
/deepseek-ai-dsh-feishu/further-exploration:
en: b25e4caa8c5b7116
zh: 4976eddc4b3e5ec4
/deepseek-ai-dsh-feishu/model-experience:
en: 215e7ba838619b7b
zh: a311da3843709f90
/deepseek-ai-dsh-feishu/model-experience/skill-catalog-entry:
en: a861712b6b65f49a
zh: 3447e587c56a25d6
/deepseek-ai-dsh-feishu/model-experience/skill-catalog-entry/what-the-model-sees:
en: 0a73c38722f334ac
zh: 56d0060443414c9a
/deepseek-ai-dsh-feishu/model-experience/skill-catalog-entry/what-the-model-sees/catalog-description:
en: 8ff7f9b51a85c5b5
zh: 55e58973015e27f7
/deepseek-ai-dsh-feishu/model-experience/skill-catalog-entry/token-effect:
en: 7bd1792c4c56e682
zh: 94be77d208dddc69
/deepseek-ai-dsh-feishu/model-experience/skill-catalog-entry/kv-cache-effect:
en: 09346f854e96f385
zh: c2fa26fbcd1cd6f1
/deepseek-ai-dsh-feishu/model-experience/loaded-skill-body:
en: 8955ac196848e69f
zh: 54aa7db097eafd3c
/deepseek-ai-dsh-feishu/model-experience/loaded-skill-body/what-the-model-sees:
en: 1f22e390a5ac1f35
zh: 305341c3bfb1758d
/deepseek-ai-dsh-feishu/model-experience/loaded-skill-body/token-effect:
en: f19372aa372976da
zh: 647eef6b6980db49
/deepseek-ai-dsh-feishu/model-experience/loaded-skill-body/kv-cache-effect:
en: 1f6b842a95e14ce4
zh: 0d57cdec5e828828
/deepseek-ai-dsh-feishu/model-experience/cli-path:
en: b5fed52af6c0d771
zh: 25b7aa5297583030
/deepseek-ai-dsh-feishu/model-experience/cli-path/what-the-model-sees:
en: fb721433c0dec520
zh: 7b17e45979e2fdca
/deepseek-ai-dsh-feishu/model-experience/cli-path/what-the-model-sees/runtime-context-entry:
en: c91314832f78f460
zh: aac156ea0b5b816a
/deepseek-ai-dsh-feishu/model-experience/cli-path/what-the-model-sees/runtime-context-entry-on-windows:
en: 54f899bbaf7ed198
zh: 31256473a192427b
/deepseek-ai-dsh-feishu/model-experience/cli-path/token-effect:
en: 2952585b710ffd05
zh: 6e93e58b6256d534
/deepseek-ai-dsh-feishu/model-experience/cli-path/kv-cache-effect:
en: 67398dd4e4b02db9
zh: a873eacd006fa656
/deepseek-ai-dsh-feishu/known-limitations-and-deferred-work:
en: 95d813f5fe6e7cb2
zh: c65fcf992ac18b69
/deepseek-ai-dsh-feishu/known-limitations-and-deferred-work/dev-note:
en: be15f75bf32de641
zh: 85de42dc5e1d934b
+179
View File
@@ -0,0 +1,179 @@
---
description: "Add the Feishu plugin to a profile: the official lark-cli with its embedded skills, and Feishu account connection on the Plugins page."
kind: "package-bundle"
---
# @deepseek-ai/dsh-feishu
English | [中文](README.zh.md)
## Summary
The Feishu plugin lets conversations use Feishu through the official `lark-cli`. It installs a pinned `@larksuite/cli`, gives the model the absolute path of its `lark-cli` executable in runtime context, and registers one `feishu` skill that indexes the guides embedded in that CLI. It registers the account with the [connector account registry](../../client/ui-connector-account/README.md), whose Plugins page section checks the default account, links an app and signs in through the CLI's browser flows, signs out, and cancels. The CLI keeps credentials in its default configuration, which the user's own terminal shares. Only macOS and Windows x64 are supported.
## Table of Contents
- [Use this package](#use-this-package)
- [Understand the implementation](#understand-the-implementation)
- [Further Exploration](#further-exploration)
- [Model Experience](#model-experience)
- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
- [Dev Note](#dev-note)
-----
<a id="use-this-package"></a>
## Use this package
### Install into a profile
Install the plugin from the Web sidebar's **Plugins** page or with the CLI:
```sh
dsh plugin --profile web add @deepseek-ai/dsh-feishu
dsh plugin --profile web remove @deepseek-ai/dsh-feishu
```
pnpm blocks the `@larksuite/cli` install script, which downloads and verifies the official native binary; approve it through the Plugins page's **Allow these scripts and retry** or the other paths that [Plugin Manager](../../boot/plugin-manager/README.md) documents. Until the executable exists, the `feishu` row fails to load with an error that names the missing path.
### What you get
After the plugin loads, one `feishu` skill joins the skill catalog. The agent loads it with the `skill` tool, opens the guide it needs, such as `lark-doc` or `lark-shared`, with `lark-cli skills read`, and runs `lark-cli` by that path through the ordinary Shell tools under the current sandbox and approval policy. When a command reports a missing app configuration or sign-in, the agent asks the user to connect Feishu on the plugin page; it runs the CLI's own setup and sign-in flow only when the user asks to finish it in the conversation. Commands that save sign-in state ask for single-command approval because they write outside the workspace.
Turning the plugin off in Plugin Manager withdraws the `feishu` skill, the path from runtime context, and the account section. The CLI configuration and sign-in stay in place.
<a id="account-operations"></a>
### Account operations
The Plugins page drives these operations through the connector account registry, which the Web app loads; a headless profile loads the plugin without it. The Host runs at most one account operation at a time and owns it, so leaving the page does not cancel it. Linking an app and signing in are separate operations, so the page starts each one from its own click.
| Operation | Effect |
|---|---|
| `check` | Checks the account again; each browser that opens the Web app starts one when no operation runs |
| `link-app` | Runs `config init --new`, which replaces the CLI's default configuration, including its sign-ins and any other app, with the app the user creates or chooses; it does not sign in. Replacing a linked app asks first |
| `sign-in` | Runs `auth login --json` for the linked app and checks that the same user is signed in |
| `sign-out` | After the user confirms, runs `auth logout --json`, which also signs out the user's own terminal, then checks again |
| Cancel | Cancels the operation during app setup or sign-in and waits for its command to exit; other steps are ignored |
A check runs `auth status --verify --json`. The account reads `connected` only when the CLI reports an available user that its server verified, `signed-out` when the user is missing, not configured, or needs a refresh, `unconfigured` when no app exists, and `unverified` otherwise, for example when verification cannot reach the server. Every state except `unconfigured` carries the configured `appId`. Each link that `config init` prints and each device-authorization link that `auth login` reports is offered only when it is an HTTPS address on `feishu.cn` or `larksuite.com`. A sign-in that leaves requested permissions ungranted (`auth login` exits with code 3 and lists them as missing) still succeeds; a command that later needs a missing permission reports it. Results report succeeded, cancelled, or failed. Failures show the command and observed exit code on the page and in the Host log; native messages, paths, and authorization data are omitted. A successful Feishu webpage does not confirm that local credentials were saved. The process running DSH needs access to the CLI configuration and system credential storage; `DSH_HOME` does not relocate either.
### Configure
| Field | Default | Meaning |
|---|---|---|
| `binDir` | the installed `@larksuite/cli` package's `bin` | Absolute directory containing an executable `lark-cli`, `lark-cli.exe` on Windows |
An account check or sign-out gets the `commandTimeoutMs` of the [`cli-account` row](../cli-account/README.md#use-this-package), 30 seconds by default. App setup and sign-in wait up to 10 minutes for the user in the browser, and each command keeps at most 1 MiB of stdout; the CLI account Service fixes both limits.
The generated [config catalog](../../../docs/config-catalog.md#deepseek-aidsh-feishu) is the exhaustive source of supported fields.
-----
<a id="understand-the-implementation"></a>
## Understand the implementation
<details>
<summary>Implementation internals — click to expand</summary>
[`cordis.patch.yml`](cordis.patch.yml) inserts this package as the `feishu` row after the profile's other layers, and the Plugins page keys the account section by this package name. [`src/index.ts`](src/index.ts) is a function plugin. It checks that `binDir/lark-cli` (`lark-cli.exe` on Windows) is executable, registers that path and the account with `ctx.cliAccounts`, and registers the skill provider. [`src/cli.ts`](src/cli.ts) locates `lark-cli` and parses the JSON output of its account commands. The [CLI account Service](../cli-account/README.md) gives the model that path in runtime context, runs each command by the same path, runs one account operation at a time, and reports a failed command by its exit code. [`src/account.ts`](src/account.ts) carries out each operation with the Feishu commands and reads setup and sign-in links from their output lines. [`src/presentation.ts`](src/presentation.ts) maps each view to the section the registry serves, in the text of [`src/locales.ts`](src/locales.ts). Disposal cancels the active operation, aborts running commands, and settles after their processes exit.
[`skills/feishu/SKILL.md`](skills/feishu/SKILL.md) is the only skill this package carries: the DSH guidance, an index of the 28 guides that `lark-cli` 1.0.97 embeds, and how to open them. [`src/skills.ts`](src/skills.ts) reads the entry once when the plugin loads and lists it as the `feishu` provider's one skill with an opaque resource base, so the catalog lists the entry and a load returns the file without running the CLI. The guides stay in the binary, and the agent reads them with `lark-cli skills read`.
</details>
-----
<a id="further-exploration"></a>
## Further Exploration
- [Connector packages](../README.md) — the group this application plugin belongs to.
- [CLI account Service](../cli-account/README.md) — command execution, the CLI path context, and account operations shared by CLI app plugins.
- [Skills](../../../docs/subsystems/skills.md) — catalog publication, loading, and precedence.
- [Connector account surfaces](../../client/ui-connector-account/README.md) — the registry and the Plugins page section that drive the account operations.
- [Plugin Manager](../../boot/plugin-manager/README.md) — installation, build-script approval, and enablement.
-----
<a id="model-experience"></a>
## Model Experience
### Skill catalog entry
#### What the model sees
One `feishu` entry appears in the skill catalog with the description below.
##### Catalog description
```markdown
Feishu (飞书) and Lark through the bundled lark-cli: documents and wiki, Base, sheets, slides, Drive files, messages and group chats, calendar, video meetings and minutes, tasks, approvals, mail, contacts, OKR, attendance, events, and the CLI's app setup and sign-in. Load it before any Feishu or Lark task; it indexes the guides and how to open them.
```
#### Token effect
The entry stays in context while the plugin is loaded, at about 350 characters.
#### KV Cache effect
The entry is fixed. Loading or unloading the plugin changes the catalog, which is republished as a new message and leaves earlier context in place.
### Loaded skill body
#### What the model sees
A `skill` tool result for `feishu` contains about 6,700 characters: the DSH guidance, an index that gives each of the 28 guides embedded in `lark-cli` 1.0.97 one line with its routing rules, and how to open a guide. The DSH guidance tells the agent to run `lark-cli` by the absolute path from the current runtime context, to ask the user to connect Feishu on the plugin page before running the CLI's setup and sign-in flow itself, and to set the narrowest `sandbox_permissions` for the commands that save sign-in state. The opening instructions tell the agent that the guides are not skills and that it reads a guide, and the files a guide references, with `lark-cli skills read`. Its resource description reads `Embedded lark-cli guides; open them with the skills read command given in the loaded skill.`
#### Token effect
Each load adds the entry body to the retained tool history. Guides and the files they reference arrive as ordinary Shell output when the agent reads them through `lark-cli`.
#### KV Cache effect
Loading appends a tool result and does not rewrite earlier context.
### CLI path
#### What the model sees
While the row is loaded, the [CLI account Service](../cli-account/README.md#model-experience) adds one required runtime-context entry with the path of `lark-cli` in `binDir`, which defaults to the installed `@larksuite/cli` package's `bin` directory.
##### Runtime-context entry
```markdown
Feishu CLI: run `lark-cli` by its absolute path "<binDir>/lark-cli"; the bare name may resolve to another installation or to none.
```
##### Runtime-context entry on Windows
```markdown
Feishu CLI: run `lark-cli` by its absolute path with the call operator, & '<binDir>\lark-cli.exe'; the bare name may resolve to another installation or to none.
```
#### Token effect
One line of about 110 characters plus the path in each runtime-context snapshot.
#### KV Cache effect
The system prompt does not change; loading or unloading the row, or a changed path, appends one runtime-context snapshot.
## Known Limitations and Deferred Work
<a id="known-limitations-and-deferred-work"></a>
- Only macOS and Windows x64 are supported; other platforms are unverified.
- Commands must run on this Host. When a composition runs them elsewhere, such as over SSH, the plugin still loads, and each command that runs `lark-cli` fails because the path does not exist there.
- The plugin uses the CLI's default configuration. Signing in or out from DSH affects the user's own terminal, and there is no DSH-private account or account picker. The plugin offers no unbind operation; turning it off keeps the configuration and sign-in.
- Sign-in reads the device-authorization link and the completion from `lark-cli auth login --json` events; a CLI version that changes those events fails the connection with a retryable result.
- The entry's guide index follows `lark-cli` 1.0.97; pinning another `@larksuite/cli` version means checking the index against that version's `lark-cli skills list`.
- Under a file sandbox, a token refresh during an ordinary command can be denied and then needs single-command approval.
<a id="dev-note"></a>
### Dev Note
<details>
<summary>Working context for maintainers — click to expand</summary>
Repository installs deny the `@larksuite/cli` install script in the root `pnpm-workspace.yaml`, so a checkout has no native binary. To run the plugin from source against the real CLI, run `node packages/connector/feishu/node_modules/@larksuite/cli/scripts/install.js` once. Specs and the `feishu-skills` session snapshot use stand-in executables through `binDir`.
</details>
+179
View File
@@ -0,0 +1,179 @@
---
description: "把飞书插件加入 profile:带内嵌技能的官方 lark-cli,以及插件页上的飞书账号连接。"
kind: "package-bundle"
---
# @deepseek-ai/dsh-feishu
[English](README.md) | 中文
## 概述
飞书插件让对话通过官方 `lark-cli` 使用飞书。它安装固定版本的 `@larksuite/cli`,在运行时上下文中把其 `lark-cli` 可执行文件的绝对路径告诉模型,并注册一个 `feishu` skill,为该 CLI 内嵌的子指南提供索引。它把账号注册到 [连接器账号注册表](../../client/ui-connector-account/README.zh.md),其插件页区块负责检查默认账号、通过 CLI 的浏览器流程关联应用并登录、退出登录以及取消操作。CLI 把凭据保存在默认配置中,用户自己的终端也共用这份配置。仅支持 macOS 和 Windows x64。
## 目录
- [使用本包](#use-this-package)
- [理解实现](#understand-the-implementation)
- [进一步探索](#further-exploration)
- [模型体验](#model-experience)
- [已知限制与延期工作](#known-limitations-and-deferred-work)
- [开发备注](#dev-note)
-----
<a id="use-this-package"></a>
## 使用本包
### 安装到 profile
在 Web 侧栏的**插件**页面安装,或使用 CLI:
```sh
dsh plugin --profile web add @deepseek-ai/dsh-feishu
dsh plugin --profile web remove @deepseek-ai/dsh-feishu
```
pnpm 会拦截 `@larksuite/cli` 的安装脚本,该脚本负责下载并校验官方原生程序;请通过插件页的**允许这些脚本并重试**,或 [Plugin Manager](../../boot/plugin-manager/README.zh.md) 记录的其他方式批准。可执行文件存在之前,`feishu` 行会加载失败,并给出缺失的路径。
### 获得的能力
插件加载后,一个 `feishu` skill 进入 skill 目录。agent 用 `skill` 工具加载它,用 `lark-cli skills read` 打开所需的子指南(例如 `lark-doc` 或 `lark-shared`),并在当前沙箱与审批策略下通过普通 Shell 工具按这个路径运行 `lark-cli`。命令报告缺少应用配置或登录时,agent 会请用户到插件页连接飞书;只有用户要求在对话中完成时,才按 CLI 自带的流程配置和登录。保存登录状态的命令会在工作区之外写入,因此会申请单条命令审批。
在 Plugin Manager 中关闭插件会撤下 `feishu` skill、运行时上下文中的路径和账号区块,CLI 配置与登录保持不变。
<a id="account-operations"></a>
### 账号操作
插件页通过 连接器账号注册表发起这些操作,注册表由 Web 应用加载;headless profile 加载插件时没有它。Host 同一时间最多运行一个账号操作并持有它,因此离开页面不会取消操作。关联应用和登录是两个独立操作,页面分别由各自的一次点击发起。
| 操作 | 作用 |
|---|---|
| `check` | 重新检查账号;没有操作运行时,每个打开 Web 应用的浏览器会触发一次 |
| `link-app` | 运行 `config init --new`,用用户新建或选择的应用替换 CLI 的默认配置,其中的登录和其他应用一并替换;不会登录。更换已关联的应用前会先询问 |
| `sign-in` | 为已关联的应用运行 `auth login --json`,并确认登录的是同一个用户 |
| `sign-out` | 用户确认后运行 `auth logout --json`,同时退出用户自己终端里的登录,然后重新检查 |
| 取消 | 在应用配置或登录期间取消操作并等待其命令退出;其他步骤会被忽略 |
检查运行 `auth status --verify --json`。只有 CLI 报告用户可用且已被服务端核实时,账号才是 `connected`;用户缺失、未配置或需要刷新时为 `signed-out`;没有应用时为 `unconfigured`;其他情况为 `unverified`,例如核实时无法连到服务端。除 `unconfigured` 外,每种状态都带有已配置的 `appId`。`config init` 打印的链接和 `auth login` 报告的设备授权链接,只有是 `feishu.cn` 或 `larksuite.com` 上的 HTTPS 地址时才会提供。登录后仍有申请的权限未被授予时(`auth login` 以退出码 3 结束并把它们列为缺失),登录仍算成功;之后需要这些权限的命令会报告缺少哪些。结果分为成功、已取消和失败。失败时,页面和 Host 日志显示命令和观察到的退出码;原生消息、路径和授权数据均不保留。飞书网页显示成功不代表本地凭据已保存。运行 DSH 的进程需要能访问 CLI 配置和系统凭据存储;`DSH_HOME` 不会迁移这两者。
### 配置
| 字段 | 默认值 | 含义 |
|---|---|---|
| `binDir` | 已安装 `@larksuite/cli` 包的 `bin` | 包含可执行 `lark-cli`(Windows 上为 `lark-cli.exe`)的绝对目录 |
账号检查和退出登录使用 [`cli-account` 行](../cli-account/README.zh.md#use-this-package)的 `commandTimeoutMs`,默认 30 秒。应用配置和登录最多等待用户在浏览器中操作 10 分钟,每条命令最多保留 1 MiB 的 stdout;这两个上限由 CLI 账号 Service 固定。
生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-feishu)是受支持字段的完整来源。
-----
<a id="understand-the-implementation"></a>
## 理解实现
<details>
<summary>实现内部机制——点击展开</summary>
[`cordis.patch.yml`](cordis.patch.yml) 在 profile 其他层之后把本包作为 `feishu` 行插入,插件页以本包名作为账号区块的 key。[`src/index.ts`](src/index.ts) 是一个函数插件。它检查 `binDir/lark-cli`(Windows 上为 `lark-cli.exe`)是否可执行,把这个路径和账号注册到 `ctx.cliAccounts`,并注册 skill 提供方。[`src/cli.ts`](src/cli.ts) 定位 `lark-cli` 并解析账号命令的 JSON 输出。[CLI 账号 Service](../cli-account/README.zh.md) 在运行时上下文中把这个路径告诉模型,按同一路径运行每条命令,一次执行一个账号操作,并以退出码报告失败的命令。[`src/account.ts`](src/account.ts) 用飞书的命令完成每个操作,并从命令输出行中读取配置与登录链接。[`src/presentation.ts`](src/presentation.ts) 用 [`src/locales.ts`](src/locales.ts) 中的文案,把每个视图映射为注册表提供的区块。释放时取消进行中的操作,中止正在运行的命令,并在这些进程退出后完成。
[`skills/feishu/SKILL.md`](skills/feishu/SKILL.md) 是本包携带的唯一 skill:DSH 指引、`lark-cli` 1.0.97 内嵌的 28 个子指南的索引,以及打开它们的方法。[`src/skills.ts`](src/skills.ts) 在插件加载时读取一次入口,并把它作为 `feishu` 提供方的唯一 skill 列出,资源基址为 opaque 类型,因此目录列出入口、加载返回该文件时都不运行 CLI。子指南留在二进制中,agent 用 `lark-cli skills read` 读取。
</details>
-----
<a id="further-exploration"></a>
## 进一步探索
- [Connector 包](../README.zh.md)——这个应用插件所属的分组。
- [CLI 账号 Service](../cli-account/README.zh.md)——CLI 应用插件共用的命令执行、CLI 路径上下文与账号操作。
- [Skills](../../../docs/subsystems/skills.zh.md)——目录发布、加载与优先级。
- [连接器账号界面](../../client/ui-connector-account/README.zh.md)——发起账号操作的注册表和插件页区块。
- [Plugin Manager](../../boot/plugin-manager/README.zh.md)——安装、构建脚本审批与启用。
-----
<a id="model-experience"></a>
## 模型体验
### Skill 目录条目
#### 模型看到什么
skill 目录中出现一个 `feishu` 条目,描述见下方。
##### 目录描述
```markdown
Feishu (飞书) and Lark through the bundled lark-cli: documents and wiki, Base, sheets, slides, Drive files, messages and group chats, calendar, video meetings and minutes, tasks, approvals, mail, contacts, OKR, attendance, events, and the CLI's app setup and sign-in. Load it before any Feishu or Lark task; it indexes the guides and how to open them.
```
#### Token 影响
插件加载期间该条目一直留在上下文中,约 350 个字符。
#### KV Cache 影响
该条目固定不变。加载或卸载插件会改变目录,目录作为新消息重新发布,不改动更早的上下文。
### 已加载的 skill 正文
#### 模型看到什么
`feishu` 的 `skill` 工具结果约 6,700 个字符:DSH 指引、为 `lark-cli` 1.0.97 内嵌的 28 个子指南各给一行并附路由规则的索引,以及打开子指南的方法。DSH 指引告诉 agent 按当前运行时上下文给出的绝对路径运行 `lark-cli`,在自己运行 CLI 的配置与登录流程之前先请用户到插件页连接飞书,并为保存登录状态的命令设置最窄的 `sandbox_permissions`。打开说明告诉 agent 子指南不是 skill,子指南及其引用的文件都用 `lark-cli skills read` 读取。其资源描述为 `Embedded lark-cli guides; open them with the skills read command given in the loaded skill.`
#### Token 影响
每次加载把入口正文加入保留的工具历史。agent 通过 `lark-cli` 读取的子指南及其引用文件作为普通 Shell 输出返回。
#### KV Cache 影响
加载会追加一条工具结果,不改写更早的上下文。
### CLI 路径
#### 模型看到什么
该行加载期间,[CLI 账号 Service](../cli-account/README.zh.md#model-experience) 添加一条必需的运行时上下文,给出 `binDir` 中 `lark-cli` 的路径;`binDir` 默认是已安装的 `@larksuite/cli` 包的 `bin` 目录。
##### 运行时上下文条目
```markdown
Feishu CLI: run `lark-cli` by its absolute path "<binDir>/lark-cli"; the bare name may resolve to another installation or to none.
```
##### Windows 上的运行时上下文条目
```markdown
Feishu CLI: run `lark-cli` by its absolute path with the call operator, & '<binDir>\lark-cli.exe'; the bare name may resolve to another installation or to none.
```
#### Token 影响
每份运行时上下文快照中一行,约 110 个字符加上路径。
#### KV Cache 影响
系统提示词不变;加载或卸载该行、或路径变化时,追加一份运行时上下文快照。
## 已知限制与延期工作
<a id="known-limitations-and-deferred-work"></a>
- 仅支持 macOS 和 Windows x64;其他平台未经验证。
- 命令必须在本 Host 上运行。组合把命令放到别处运行(例如通过 SSH)时,插件仍会加载,但每条运行 `lark-cli` 的命令都会因为那里没有这个路径而失败。
- 插件使用 CLI 的默认配置。在 DSH 中登录或退出会影响用户自己的终端,没有 DSH 私有账号或账号选择器。插件不提供解绑操作;关闭插件会保留配置与登录。
- 登录从 `lark-cli auth login --json` 的事件中读取设备授权链接和完成结果;CLI 版本改变这些事件时,连接以可重试的结果失败。
- 入口的子指南索引对应 `lark-cli` 1.0.97;固定到另一个 `@larksuite/cli` 版本时,需要对照该版本的 `lark-cli skills list` 检查索引。
- 在文件沙箱下,普通命令中的 token 刷新可能被拒绝,此时需要单条命令审批。
<a id="dev-note"></a>
### 开发备注
<details>
<summary>维护者工作上下文——点击展开</summary>
仓库安装在根目录 `pnpm-workspace.yaml` 中拒绝 `@larksuite/cli` 的安装脚本,因此检出的仓库没有原生二进制。要在源码中用真实 CLI 运行插件,请执行一次 `node packages/connector/feishu/node_modules/@larksuite/cli/scripts/install.js`。单测与 `feishu-skills` 会话快照通过 `binDir` 使用替身可执行文件。
</details>
@@ -0,0 +1,3 @@
- insert:
- id: feishu
name: '@deepseek-ai/dsh-feishu'
+1
View File
@@ -0,0 +1 @@
![The connected Feishu account on the plugin page and a conversation that creates and shares a Feishu doc](preview.svg)
@@ -0,0 +1 @@
![插件页上已连接的飞书账号,以及在对话中创建飞书文档并发到群里](preview.zh.svg)
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300"><rect x="0" y="0" width="640" height="300" fill="#F5F6FC"/><path d="M50.5 53.1 Q50.5 55.4 49.6 57.1 Q48.8 58.8 47.4 59.9 Q46 60.9 44.3 61.5 Q42.5 62 40.7 62 H33.2 V61.1 Q33.6 61.1 34.2 61 Q34.7 61 34.9 60.9 Q35.3 60.7 35.5 60.4 Q35.7 60.1 35.7 59.6 V46.6 Q35.7 46.2 35.5 45.8 Q35.4 45.5 34.9 45.3 Q34.5 45.1 34.1 45 Q33.6 44.9 33.3 44.9 V44 H41.2 Q42.8 44 44.4 44.5 Q45.9 45 47.1 45.8 Q48.7 47 49.6 48.8 Q50.5 50.6 50.5 53.1 ZM47.4 53.1 Q47.4 51.3 46.9 49.8 Q46.4 48.3 45.5 47.2 Q44.6 46.2 43.3 45.6 Q42.1 45 40.5 45 Q40 45 39.3 45 Q38.7 45.1 38.4 45.1 V58.9 Q38.4 60.1 39 60.5 Q39.7 61 41.1 61 Q42.7 61 43.9 60.4 Q45.1 59.8 45.9 58.8 Q46.7 57.7 47 56.3 Q47.4 54.9 47.4 53.1 ZM62 51.1 Q62 51.7 61.7 52.2 Q61.3 52.7 60.7 52.7 Q60 52.7 59.6 52.4 Q59.2 52 59.2 51.6 Q59.2 51.3 59.3 51.1 Q59.3 50.8 59.3 50.6 Q58.7 50.6 57.9 51.1 Q57.1 51.6 56.6 52.5 V59.7 Q56.6 60.2 56.8 60.5 Q56.9 60.7 57.3 60.9 Q57.6 61 58.1 61.1 Q58.6 61.1 59 61.2 V62 H52.4 V61.2 Q52.7 61.1 53 61.1 Q53.3 61.1 53.5 61 Q53.9 60.9 54.1 60.6 Q54.2 60.3 54.2 59.9 V52.1 Q54.2 51.7 54 51.4 Q53.9 51 53.5 50.8 Q53.3 50.6 53 50.5 Q52.6 50.5 52.2 50.4 V49.6 L56.4 49.3 L56.6 49.5 V51.3 H56.7 Q57.4 50.2 58.4 49.7 Q59.4 49.2 60.2 49.2 Q61 49.2 61.5 49.7 Q62 50.2 62 51.1 ZM74.9 61.8 Q74.3 62 73.9 62.1 Q73.4 62.3 72.8 62.3 Q71.8 62.3 71.2 61.8 Q70.7 61.3 70.5 60.4 H70.4 Q69.6 61.4 68.6 61.8 Q67.7 62.3 66.4 62.3 Q65 62.3 64 61.5 Q63.1 60.6 63.1 59.2 Q63.1 58.5 63.3 57.9 Q63.5 57.3 64 56.9 Q64.3 56.5 64.8 56.2 Q65.3 55.9 65.8 55.7 Q66.3 55.5 68.1 54.9 Q69.8 54.3 70.4 54 V52.7 Q70.4 52.6 70.4 52.1 Q70.3 51.6 70.1 51.2 Q69.8 50.8 69.4 50.4 Q68.9 50.1 68 50.1 Q67.5 50.1 67 50.3 Q66.5 50.4 66.3 50.7 Q66.3 50.9 66.4 51.4 Q66.5 51.9 66.5 52.3 Q66.5 52.8 66.1 53.1 Q65.7 53.5 65 53.5 Q64.3 53.5 64 53.1 Q63.8 52.6 63.8 52 Q63.8 51.5 64.2 50.9 Q64.6 50.4 65.2 50 Q65.8 49.6 66.6 49.4 Q67.4 49.1 68.2 49.1 Q69.3 49.1 70.1 49.3 Q70.9 49.4 71.5 49.9 Q72.2 50.4 72.5 51.2 Q72.8 52 72.8 53.3 Q72.8 55.1 72.8 56.5 Q72.8 57.9 72.8 59.5 Q72.8 60 72.9 60.3 Q73.1 60.6 73.5 60.8 Q73.6 60.9 74.1 60.9 Q74.5 61 74.9 61 ZM70.5 55.1 Q69.4 55.4 68.6 55.7 Q67.8 56 67.1 56.5 Q66.4 56.9 66.1 57.5 Q65.7 58.1 65.7 58.9 Q65.7 59.9 66.2 60.4 Q66.8 60.9 67.6 60.9 Q68.5 60.9 69.2 60.5 Q69.9 60 70.4 59.4 ZM85.5 43.9 Q85.5 44.4 85.2 44.8 Q84.9 45.2 84.2 45.2 Q83.8 45.2 83.5 45.1 Q83.2 44.9 83 44.6 Q82.7 44.3 82.5 44 Q82.3 43.6 82.1 43.4 Q81.3 43.4 80.8 44.6 Q80.4 45.7 80.4 48.3 V49.5 H83.6 V50.8 H80.4 V59.7 Q80.4 60.2 80.5 60.5 Q80.7 60.7 81.1 60.9 Q81.4 61 81.9 61.1 Q82.4 61.1 82.8 61.2 V62 H76.2 V61.2 Q76.5 61.1 76.8 61.1 Q77.1 61.1 77.3 61 Q77.7 60.9 77.8 60.6 Q78 60.3 78 59.9 V50.8 H75.5 V49.5 H78 V48.7 Q78 45.9 79.5 44.1 Q81 42.3 83.2 42.3 Q84.3 42.3 84.9 42.8 Q85.5 43.2 85.5 43.9 ZM92.3 61.5 Q91.5 61.8 90.8 62 Q90 62.3 89 62.3 Q87.4 62.3 86.7 61.5 Q86.1 60.7 86.1 59.2 V50.8 H83.8 V49.5 H86.2 V45.6 H88.5 V49.5 H92.1 V50.8 H88.5 V57.7 Q88.5 58.5 88.6 59.1 Q88.6 59.6 88.8 60 Q89 60.3 89.4 60.5 Q89.8 60.7 90.5 60.7 Q90.8 60.7 91.5 60.7 Q92.1 60.6 92.3 60.5 ZM111.7 61.8 Q111.1 62 110.7 62.1 Q110.2 62.3 109.6 62.3 Q108.6 62.3 108.1 61.8 Q107.5 61.3 107.3 60.4 H107.2 Q106.4 61.4 105.4 61.8 Q104.5 62.3 103.2 62.3 Q101.8 62.3 100.9 61.5 Q99.9 60.6 99.9 59.2 Q99.9 58.5 100.1 57.9 Q100.4 57.3 100.8 56.9 Q101.1 56.5 101.6 56.2 Q102.1 55.9 102.6 55.7 Q103.1 55.5 104.9 54.9 Q106.6 54.3 107.2 54 V52.7 Q107.2 52.6 107.2 52.1 Q107.1 51.6 106.9 51.2 Q106.6 50.8 106.2 50.4 Q105.7 50.1 104.8 50.1 Q104.3 50.1 103.8 50.3 Q103.3 50.4 103.1 50.7 Q103.1 50.9 103.2 51.4 Q103.3 51.9 103.3 52.3 Q103.3 52.8 102.9 53.1 Q102.5 53.5 101.8 53.5 Q101.2 53.5 100.9 53.1 Q100.6 52.6 100.6 52 Q100.6 51.5 101 50.9 Q101.4 50.4 102 50 Q102.6 49.6 103.4 49.4 Q104.2 49.1 105 49.1 Q106.1 49.1 106.9 49.3 Q107.7 49.4 108.3 49.9 Q109 50.4 109.3 51.2 Q109.6 52 109.6 53.3 Q109.6 55.1 109.6 56.5 Q109.6 57.9 109.6 59.5 Q109.6 60 109.7 60.3 Q109.9 60.6 110.3 60.8 Q110.4 60.9 110.9 60.9 Q111.3 61 111.7 61 ZM107.3 55.1 Q106.2 55.4 105.4 55.7 Q104.6 56 103.9 56.5 Q103.2 56.9 102.9 57.5 Q102.5 58.1 102.5 58.9 Q102.5 59.9 103 60.4 Q103.6 60.9 104.5 60.9 Q105.4 60.9 106 60.5 Q106.7 60 107.2 59.4 ZM132.9 61.8 L128.6 62.1 L128.4 61.9 V60.7 H128.3 Q127.6 61.4 126.6 61.9 Q125.7 62.4 124.6 62.4 Q123.6 62.4 122.6 61.9 Q121.6 61.4 120.8 60.5 Q120.1 59.7 119.7 58.4 Q119.2 57.2 119.2 55.7 Q119.2 54.4 119.7 53.1 Q120.2 51.9 121 51 Q121.8 50.2 122.9 49.6 Q124 49.1 125.2 49.1 Q126 49.1 126.9 49.4 Q127.7 49.6 128.3 49.9 V45.6 Q128.3 45 128.2 44.6 Q128 44.2 127.7 43.9 Q127.3 43.7 126.7 43.6 Q126.1 43.5 125.4 43.4 V42.6 L130.5 42.3 L130.7 42.5 V59.4 Q130.7 59.9 130.9 60.2 Q131.1 60.5 131.4 60.7 Q131.6 60.9 132.1 60.9 Q132.5 60.9 132.9 60.9 ZM128.3 59.6 V52.3 Q128.2 51.9 128 51.5 Q127.8 51.2 127.4 50.8 Q127.1 50.5 126.6 50.3 Q126.1 50.1 125.4 50.1 Q124.7 50.1 124 50.5 Q123.4 50.9 122.9 51.6 Q122.4 52.3 122.1 53.4 Q121.9 54.5 121.9 55.9 Q121.9 56.9 122.1 57.8 Q122.3 58.7 122.8 59.4 Q123.2 60.Line truncated

After

Width:  |  Height:  |  Size: 170 KiB

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300"><rect x="0" y="0" width="640" height="300" fill="#F5F6FC"/><path d="M37.9 55.7 Q36 57.6 33.5 59.5 L33.1 59.1 Q35.6 57 37.9 54 Q37.9 51.6 37.8 50 L39.6 51.5 Q40.9 49.5 41.8 47.7 H36 Q34.9 47.7 34.2 47.9 L33.2 46.8 Q34.2 47 35.4 47 H42.2 Q43.5 44.2 44.1 41.7 L46.4 42.8 Q46.8 43 46.8 43.1 Q46.8 43.3 46.3 43.4 Q46.1 43.5 45.7 44.1 L44.2 47 H53.4 L55 45.1 L56.7 47.2 Q56.9 47.5 56.9 47.6 Q56.9 47.7 56.5 47.7 H43.8 Q41.9 51.1 39.8 53.6 V59.8 Q39.8 62.2 39.9 63.2 L40.1 65 Q40.1 65.5 39.2 66 Q38.3 66.6 38 66.6 Q37.6 66.6 37.7 65.5 Q37.9 63.6 37.9 60.1 ZM49 63.3 H53.5 L55.1 61.3 L57 63.6 Q57.2 63.8 57.2 63.9 Q57.2 64 56.8 64 H42.8 Q41.7 64 41 64.3 L40.1 63.1 Q41.1 63.3 42.3 63.3 H47 V55.9 H44 Q42.9 55.9 42.2 56.2 L41.3 55 Q42.2 55.2 43.4 55.2 H47 V52.8 Q47 50.6 46.9 48.5 L49.7 49.8 Q50 49.9 50 50 Q50 50.1 49.7 50.3 L49 50.7 V55.2 H52.3 L53.7 53.4 L55.3 55.4 Q55.5 55.6 55.5 55.7 Q55.5 55.9 55.2 55.9 H49 ZM71.2 45.4 H62.9 Q61.8 45.4 61.1 45.7 L60.2 44.6 Q61.2 44.7 62.4 44.7 H70.7 L72.1 43 L74 44.6 Q74.3 44.8 74.3 45 Q74.3 45.2 74 45.3 L73.1 45.8 Q72.3 49.5 72.3 53.5 Q72.3 56 72.6 57.2 Q72.8 58.4 73.5 59.6 Q74.2 60.8 75.2 61.7 Q76.2 62.6 77.4 63.1 Q78.7 63.7 79.3 63.7 Q80.2 63.7 80.7 62.4 Q81.2 61.1 81.8 58.5 L82.3 58.6 Q81.9 61.1 81.9 62.8 Q81.9 64.5 82.5 64.9 Q82.8 65.1 82.8 65.4 Q82.8 66 81.3 66 Q79.9 66 77.6 65.2 Q75.4 64.4 73.7 62.8 Q72 61.1 71.3 59.1 Q70.7 57.1 70.7 53.1 Q70.7 49.1 71.2 45.4 ZM74.1 52.1 Q75.7 52.7 76.8 53.2 Q78 53.7 78.7 54.2 Q79.4 54.7 79.7 55.2 Q79.9 55.6 79.9 56.3 Q79.9 56.9 79.7 57.5 Q79.4 58 79 58 Q78.5 58 78.1 57.1 Q77.6 56.2 76 54.6 Q74.4 53.1 72.6 52 L72.7 51.7 Q73.2 51.9 73.5 52 Q77.3 47.9 78.7 44.7 L80.6 46.6 Q80.9 46.9 80.9 47 Q80.9 47.2 80.5 47.3 Q80.2 47.4 79.7 47.7 Q79.2 48 78.8 48.4 Q78.4 48.8 76.9 50 Q75.4 51.2 74.1 52.1 ZM95.3 54.3 V48.7 H90.2 Q89.1 48.7 88.4 49 L87.5 47.8 Q88.5 48 89.7 48 H95.3 V46.1 Q95.3 43.8 95.2 41.7 L97.9 42.8 Q98.2 42.9 98.2 43.1 Q98.2 43.2 97.9 43.4 L97.1 43.9 V48 H102.3 L103.3 46.7 L105.1 48.2 Q105.4 48.3 105.4 48.5 Q105.4 48.6 105.1 48.8 L104.3 49.2 L103.9 54.3 H105.7 L106.7 52.9 L108.5 54.6 Q108.7 54.8 108.7 54.9 Q108.7 55.1 108.5 55.2 L107.9 55.8 Q107.8 56.9 107.4 58.8 Q107.1 60.6 106.7 61.6 Q106.3 62.6 105.1 63.3 Q104 64 103.7 64 Q103.5 64 103.4 63.6 Q103.2 62.6 102.6 62.1 Q102 61.6 100.5 61.3 L100.6 60.8 Q103 61.3 103.7 61.3 Q104.5 61.3 104.8 60.9 Q105.1 60.5 105.5 58.9 Q105.9 57.4 106.1 55 H97.1 V60.7 Q97.1 62.9 97.1 63.9 Q97.2 64.8 97.2 65 Q97.2 65.5 96.4 65.8 Q95.7 66.2 95.5 66.2 Q95.2 66.2 95.2 66 Q95.1 65.8 95.1 65.3 Q95.3 63.2 95.3 60.1 V55 H88 Q86.9 55 86.3 55.3 L85.3 54.1 Q86.3 54.3 87.5 54.3 ZM97.1 48.7 V54.3 H102.1 L102.6 48.7 ZM102.4 43.7 Q105.7 44.6 106.8 45.3 Q107.9 46 107.9 47.1 Q107.9 47.6 107.6 47.9 Q107.4 48.3 106.9 48.3 Q106.5 48.3 106 47.5 Q105 46.1 102.1 44 ZM115.1 44.4 H130.9 L131.9 42.9 L134 44.9 Q134.4 45.3 134.4 45.4 Q134.4 45.6 133.8 45.6 Q132.3 45.7 130.4 47.6 L129.9 47.3 L131 45.1 H115.2 Q115.3 45.5 115.3 45.9 Q115.3 47.6 114.6 48.4 Q113.8 49.2 113.2 49.2 Q112.8 49.2 112.5 48.9 Q112.1 48.7 112.1 48.3 Q112.1 47.8 112.8 47.1 Q113.4 46.5 113.7 45.8 Q114.1 45 114.1 44.3 Q114.1 43.6 114 43 L114.6 42.9 Q114.9 43.5 115.1 44.4 ZM119.1 50.8 L118.8 54.5 H129.7 L130.6 53.3 L132.7 55 Q132.9 55.2 132.9 55.4 Q132.9 55.5 132.6 55.6 L131.6 56.2 Q131 62.2 130.3 63.5 Q129.5 64.8 128.1 65.4 Q126.6 66 126.3 66 Q126.1 66 126.1 65.7 Q126.1 65.1 125.9 64.7 Q125.7 64.4 125 64.1 Q124.4 63.8 122.9 63.4 L123.1 62.9 Q125.2 63.3 126.5 63.3 Q127.7 63.3 128.3 62.8 Q128.8 62.3 129 60.8 Q129.3 59.4 129.8 55.2 H118.9 L118.3 56.2 Q118.2 56.4 118.1 56.4 Q118 56.4 117.7 56.2 L116 55 Q116.6 54.6 116.7 54.3 Q116.9 54 117 53.1 L117.5 48 Q117.7 46.5 117.6 45.5 L120 46.3 Q120.2 46.4 120.2 46.6 Q120.2 46.8 120 47 L119.4 47.5 L119.2 50.1 H128.7 L130.4 48.1 L132.3 50.4 Q132.4 50.6 132.4 50.7 Q132.4 50.8 132.1 50.8 ZM126.7 59.4 Q126.9 59.6 126.9 59.8 Q126.9 59.9 126.5 59.9 H113.8 Q112.7 59.9 112 60.2 L111.1 59.1 Q112.1 59.2 113.3 59.2 H123.3 L124.9 57.3 ZM147.1 42.2 Q149 42.9 149.8 43.7 Q150.5 44.4 150.5 45.3 Q150.5 45.9 150 46.4 Q149.4 47 148.8 47 Q148.3 47 148.2 46.1 Q148.2 44.7 147.8 44 Q147.5 43.3 146.8 42.5 ZM143.5 48.2 H140.1 Q139.1 48.2 138.3 48.5 L137.4 47.3 Q138.4 47.4 139.5 47.4 H157.1 L158.8 45.4 L160.8 47.7 Q160.9 47.9 160.9 48.1 Q160.9 48.2 160.5 48.2 H155 Q153.1 55.6 150.2 59.4 Q153.6 62.1 160.9 63.3 V63.7 Q160 63.8 159.5 64.1 Q159 64.4 158.6 65.4 Q158.5 65.6 158.4 65.6 Q158 65.6 156 64.8 Q153.9 64 152.1 62.9 Q150.4 61.8 149.1 60.5 Q144.9 64.4 137.3 66.3 L137.1 65.9 Q144.4 63.3 148.2 59.4 Q144.9 55.3 143.5 48.2 ZM153 48.2 H144.3 Q146.1 54.9 149 58.3 Q150.3 56.6 151.2 54.4 Q152.1 52.1 153 48.2 ZM169.1 52.3 Q170.6 52.7 171.6 53.4 Q172.5 54.1 172.5 54.8 Q172.5 55.5 172.2 56 Q171.8 56.6 171.5 56.6 Q170.9 56.6 170.8 55.8 Q170.5 53.8 169.1 52.7 V60.3 Q169.1 62.8 169.1 64 Q169.2 65.1 169.2 65.2 Q169.2 65.7 168.4 66.1 Q167.6 66.6 167.4 66.6 Q167.1 66.6 167.1 65.9 L167.2 63.1 QLine truncated

After

Width:  |  Height:  |  Size: 110 KiB

+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" fill="none"><g transform="translate(1.554152909 2.152960008) scale(1.980804481)"><path d="M8.5611 8.26287L8.59322 8.23075C8.6141 8.20988 8.63658 8.18739 8.65906 8.16652L8.70402 8.12316L8.8373 7.99148L9.02037 7.81324L9.17613 7.65908L9.32226 7.51456L9.47481 7.36361L9.61452 7.22551L9.81043 7.03281C9.84737 6.99588 9.8859 6.96055 9.92444 6.92522C9.9951 6.86099 10.069 6.79836 10.1428 6.73734C10.2119 6.68274 10.2825 6.62975 10.3548 6.57836C10.456 6.5061 10.5603 6.44026 10.6663 6.37603C10.7707 6.31501 10.8783 6.2572 10.9875 6.2026C11.0903 6.15282 11.1963 6.10625 11.3038 6.0645C11.3633 6.04041 11.4243 6.01954 11.4853 5.99866C11.5158 5.98903 11.5463 5.97779 11.5784 5.96815C11.3071 4.90028 10.8109 3.90468 10.122 3.04556C9.98868 2.88016 9.78634 2.78381 9.57438 2.78381H3.94598C3.88817 2.78381 3.84 2.83038 3.84 2.8898C3.84 2.92352 3.85605 2.95403 3.88335 2.97491C5.80391 4.38321 7.39689 6.19297 8.54826 8.27732L8.5611 8.26287Z" fill="#00D6B9" />
<path d="M6.32424 13.2168C9.23077 13.2168 11.7631 11.6126 13.0831 9.24238C13.1297 9.15887 13.1747 9.07537 13.218 8.99026C13.1522 9.11712 13.0783 9.23917 12.9964 9.35478C12.9675 9.39493 12.9386 9.43508 12.9081 9.47522C12.8696 9.525 12.831 9.57157 12.7909 9.61814C12.7588 9.65507 12.7266 9.6904 12.6929 9.72573C12.6255 9.79638 12.5548 9.86383 12.4809 9.92646C12.4392 9.96178 12.3991 9.99551 12.3557 10.0276C12.3059 10.0662 12.2545 10.1031 12.2031 10.1368C12.171 10.1593 12.1373 10.1802 12.1036 10.2011C12.0699 10.2219 12.0345 10.2428 11.9976 10.2637C11.9253 10.3038 11.8499 10.3424 11.7744 10.3761C11.7085 10.405 11.6411 10.4323 11.5737 10.458C11.4998 10.4853 11.4259 10.5094 11.3488 10.5302C11.2348 10.5624 11.1208 10.5864 11.0036 10.6041C10.9201 10.617 10.8334 10.6266 10.7483 10.633C10.6583 10.6394 10.5668 10.641 10.4753 10.641C10.3741 10.6394 10.2729 10.633 10.1702 10.6218C10.0947 10.6137 10.0192 10.6025 9.94375 10.5897C9.87791 10.5784 9.81208 10.564 9.74624 10.5479C9.71091 10.5399 9.67719 10.5302 9.64186 10.5206C9.54551 10.4949 9.44916 10.4676 9.35281 10.4403C9.30464 10.4259 9.25646 10.413 9.20989 10.3986C9.13763 10.3777 9.06698 10.3552 8.99632 10.3327C8.93851 10.3151 8.8807 10.2958 8.82289 10.2765C8.76829 10.2589 8.71209 10.2412 8.65749 10.2219L8.54508 10.1834C8.50012 10.1673 8.45355 10.1513 8.40859 10.1352L8.31224 10.0999C8.24801 10.0774 8.18378 10.0533 8.12115 10.0292C8.08421 10.0148 8.04728 10.0019 8.01035 9.98748C7.96057 9.96821 7.91239 9.94894 7.86261 9.92967C7.81123 9.90879 7.75823 9.88792 7.70685 9.86704L7.60568 9.82529L7.48043 9.7739L7.38408 9.73376L7.28452 9.6904L7.1978 9.65186L7.11912 9.61653L7.03883 9.5796L6.95693 9.54106L6.85255 9.49288L6.74336 9.4415C6.70482 9.42223 6.66628 9.40456 6.62774 9.38529L6.52978 9.33712C4.80192 8.4748 3.24267 7.31218 1.92269 5.90227C1.88254 5.86052 1.8167 5.85731 1.77335 5.89746C1.75247 5.91673 1.73962 5.94563 1.73962 5.97454L1.74284 10.9413V11.3444C1.74284 11.5788 1.85845 11.7972 2.05276 11.9273C3.31654 12.772 4.80353 13.22 6.32424 13.2168Z" fill="#3370FF" />
<path d="M14.8656 6.21539C13.8844 5.73525 12.7619 5.63248 11.7101 5.92795C11.6652 5.94079 11.6218 5.95364 11.5784 5.96649C11.5479 5.97612 11.5174 5.98576 11.4853 5.997C11.4243 6.01787 11.3633 6.04036 11.3039 6.06284C11.1963 6.10459 11.0919 6.15116 10.9875 6.20094C10.8783 6.25393 10.7707 6.31174 10.6663 6.37276C10.5588 6.43539 10.456 6.50283 10.3548 6.57509C10.2825 6.62648 10.2119 6.67947 10.1428 6.73407C10.0674 6.79509 9.99511 6.85611 9.92445 6.92195C9.88591 6.95728 9.84898 6.99261 9.81044 7.02954L9.61453 7.22224L9.47482 7.36034L9.32227 7.51129L9.17614 7.65581L9.02038 7.80997L8.83892 7.98982L8.70564 8.1215L8.66067 8.16485C8.6398 8.18573 8.61732 8.20821 8.59483 8.22909L8.56272 8.2612L8.51294 8.30777C8.49367 8.32544 8.476 8.34149 8.45673 8.35916C7.97338 8.80397 7.43383 9.18455 6.85413 9.49447L6.9585 9.54265L7.0404 9.58119L7.12069 9.61812L7.19938 9.65345L7.28609 9.69199L7.38565 9.73534L7.482 9.77549L7.60725 9.82688L7.70842 9.86863C7.75981 9.8895 7.8128 9.91038 7.86419 9.93125C7.91236 9.95052 7.96214 9.9698 8.01192 9.98907C8.04886 10.0035 8.08579 10.0164 8.12272 10.0308C8.18696 10.0549 8.25119 10.0774 8.31382 10.1015L8.41016 10.1368C8.45513 10.1529 8.50009 10.1689 8.54666 10.185L8.65907 10.2235C8.71366 10.2412 8.76826 10.2604 8.82447 10.2781C8.88228 10.2974 8.94008 10.315 8.99789 10.3343C9.06855 10.3568 9.14081 10.3777 9.21147 10.4002C9.25964 10.4146 9.30782 10.4291 9.35439 10.4419C9.45073 10.4692 9.54708 10.4965 9.64343 10.5222C9.67876 10.5318 9.71248 10.5399 9.74781 10.5495C9.81365 10.5656 9.87949 10.5784 9.94533 10.5912C10.0208 10.6041 10.0963 10.6153 10.1717 10.6234C10.2745 10.6346 10.3757 10.641 10.4769 10.6426C10.5684 10.6442 10.6599 10.641 10.7498 10.6346C10.8366 10.6282 10.9217 10.6185 11.0052 10.6057C11.1208 10.588 11.2364 10.5623 11.3504 10.5318C11.4259 10.511 11.5014 10.4869 11.5752 10.4596C11.6427 10.4355 11.7101 10.4082 11.776 10.3777C11.8514 10.344 11.9269 10.3054 11.9992 10.2653C12.0345 10.246 12.0698 10.2251 12.1052 10.2026C12.1405 10.1818 12.1726 10.1593 12.2047 10.1384C12.2561 10.1031 12.3075 10.0677 12.3573 10.0292C12.4006 9.99709 12.4424 9.96337 12.4825 9.92804C12.5548 9.86542 12.6254 9.79797 12.6929 9.72732C12.7266 9.69199 12.7587 9.65666 12.7908 9.61973C12.831 9.57316 12.8711 9.52498 12.9081 9.47681C12.9386 9.43827 12.9675 9.39812 12.9964 9.35637C13.0767 9.24075 13.1505 9.12032 13.2164 8.99506L13.2919 8.84572L13.9631 7.50807L13.9711 7.49202C14.1927 7.01348 14.4946 6.58312 14.8656 6.21539Z" fill="#133C9A" />
</g></svg>

After

Width:  |  Height:  |  Size: 5.4 KiB

+7
View File
@@ -0,0 +1,7 @@
{
"meta": {
"title": "Feishu-Plugin",
"description": "Verwenden Sie Dokumente, Nachrichten und weitere autorisierte Funktionen von Feishu in Unterhaltungen.",
"detail": "docs/DETAIL.md"
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"meta": {
"title": "Feishu plugin",
"description": "Use Feishu documents, messages, and other authorized features in conversations.",
"detail": "docs/DETAIL.md"
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"meta": {
"title": "Complemento de Feishu",
"description": "Use documentos, mensajes y otras funciones autorizadas de Feishu en las conversaciones.",
"detail": "docs/DETAIL.md"
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"meta": {
"title": "Plugin Feishu",
"description": "Utilisez les documents, les messages et les autres fonctionnalités autorisées de Feishu dans les conversations.",
"detail": "docs/DETAIL.md"
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"meta": {
"title": "Feishu プラグイン",
"description": "会話の中で Feishu のドキュメント、メッセージ、その他の承認済み機能を使用します。",
"detail": "docs/DETAIL.md"
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"meta": {
"title": "Plugin do Feishu",
"description": "Use documentos, mensagens e outros recursos autorizados do Feishu nas conversas.",
"detail": "docs/DETAIL.md"
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"meta": {
"title": "Плагин Feishu",
"description": "Используйте документы, сообщения и другие разрешённые функции Feishu в беседах.",
"detail": "docs/DETAIL.md"
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"meta": {
"title": "飞书插件",
"description": "在对话中使用飞书文档、消息及其他已授权的功能。",
"detail": "docs/DETAIL.zh.md"
}
}
+66
View File
@@ -0,0 +1,66 @@
{
"name": "@deepseek-ai/dsh-feishu",
"description": "Feishu plugin: the official lark-cli with its embedded skills, and account connection from the Plugins page",
"version": "0.2.2-rc.5",
"icon": "./icon.svg",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
"directory": "packages/connector/feishu"
},
"type": "module",
"main": "lib/index.js",
"types": "lib/types/index.d.ts",
"exports": {
".": {
"types": "./lib/types/index.d.ts",
"default": "./lib/index.js"
},
"./locale/*.json": "./locale/*.json",
"./src/*": "./src/*",
"./package.json": "./package.json",
"./cordis.patch.yml": "./cordis.patch.yml"
},
"files": [
"icon.svg",
"locale/*.json",
"docs",
"lib/index.js",
"cordis.patch.yml",
"skills",
"lib/types/**/*.d.ts",
"lib/types/**/*.d.ts.map",
"lib/**/*.js.map",
"src"
],
"license": "MIT",
"dsh": {
"bundle": {
"patch": "./cordis.patch.yml"
}
},
"dependencies": {
"@deepseek-ai/dsh-brand": "workspace:*",
"@deepseek-ai/dsh-util-values": "workspace:*",
"@deepseek-ai/schemastery": "workspace:~",
"@larksuite/cli": "1.0.97",
"yaml": "^2.4.2",
"zod": "^4.4.3"
},
"peerDependencies": {
"@deepseek-ai/cordis": "workspace:~",
"@deepseek-ai/dsh-cli-account": "workspace:*",
"@deepseek-ai/dsh-skill": "workspace:*"
},
"devDependencies": {
"@deepseek-ai/cordis": "workspace:~",
"@deepseek-ai/dsh-cli-account": "workspace:*",
"@deepseek-ai/dsh-client-ui-connector-account": "workspace:*",
"@deepseek-ai/dsh-skill": "workspace:*",
"@deepseek-ai/dsh-subprocess": "workspace:*",
"@deepseek-ai/dsh-system-prompt": "workspace:*"
}
}
@@ -0,0 +1,51 @@
---
name: feishu
description: "Feishu (飞书) and Lark through the bundled lark-cli: documents and wiki, Base, sheets, slides, Drive files, messages and group chats, calendar, video meetings and minutes, tasks, approvals, mail, contacts, OKR, attendance, events, and the CLI's app setup and sign-in. Load it before any Feishu or Lark task; it indexes the guides and how to open them."
---
# Feishu in DSH
Call this integration the Feishu plugin (飞书插件 in Chinese) in user-facing replies. Run `lark-cli` in the Host Shell by the absolute path that the current runtime context gives for it, not by name; DSH installs the version this plugin pins. It uses the default lark-cli configuration and sign-in shared with the user's own terminal, so do not remove, switch, or sign out of apps or profiles unless the user asks.
When a command reports a missing app configuration or sign-in, first ask the user to connect Feishu on the Feishu plugin page in Plugins. Open the lark-shared guide and run its setup and auth flow yourself only when the user asks to finish it in this conversation. Never ask for or print app secrets or tokens.
Commands that save sign-in state, such as `auth login --device-code` and `config init`, write outside the workspace and use up their one-time authorization even when the save is denied: on the first attempt, set the Shell tool's `sandbox_permissions` to the narrowest mode that can write outside the workspace, with a `justification`. Run other commands in the existing sandbox and set `sandbox_permissions` only when a credential, lock, log, or cache write is denied.
Do not install another lark-cli or run `lark-cli update`.
## Guides
- `lark-approval`: Feishu Approval: list and handle approval tasks, look up instances, search the definitions you can start, and start native approval instances; to-dos that are not approvals belong to `lark-task`.
- `lark-apps`: Miaoda (Spark) app development and hosting: create apps, develop locally or in the cloud, design mockups and prototypes, deploy and publish, and manage logs, metrics, environment variables, collaborators, roles, and automation triggers; use for apps served from `*.aiforce.cloud`.
- `lark-attendance`: Feishu Attendance: read your own check-in records.
- `lark-base`: Feishu Base (bitable): tables, fields, records, views, statistics, formulas, forms, dashboards, BaseApp pages, workspaces, workflows, roles, and templates; use for `/base/` and `/app/` links.
- `lark-calendar`: Feishu Calendar: view, search, create, and update events, manage attendees, query free/busy and suggested times, and book meeting rooms; past video meetings belong to `lark-meeting` and to-dos to `lark-task`.
- `lark-contact`: Feishu contacts: resolve a name or email to an `open_id`, look a user up by `open_id`, and search the bots and agents you can see; department trees need the native OpenAPI.
- `lark-doc`: Feishu Docs and Wiki documents: read, create, and edit documents, insert or download image attachments, and work with mind notes; route by document URL or token, including `doubao.com` `/docx/` and `/wiki/` links.
- `lark-drive`: Feishu Drive: files and folders, upload and download, copy, move, delete, metadata, permissions, comments, subscriptions, titles, versions, security labels, and importing local Word, Markdown, Excel, CSV, PPTX, or `.base` files as Feishu documents.
- `lark-event`: Feishu real-time events: subscribe to and consume message, approval, task, meeting, minutes, and whiteboard events as NDJSON, with bounded runs for agents that run as subprocesses.
- `lark-im`: Feishu Messenger: send and reply to messages, search chat history, manage group chats and members, transfer images and files, reactions, urgent notices, pinned feeds, interactive cards, and card callbacks.
- `lark-mail`: Feishu Mail: draft, send, reply to, forward, read, and search mail, and manage folders, labels, mail contacts, new-mail listeners, and inbox rules; mail intent only.
- `lark-markdown`: Feishu Markdown files: view, create, upload, edit, and diff native Markdown files in Feishu, including comparing the remote version with a local draft.
- `lark-meeting`: Feishu video meetings: meeting records and artifacts such as minutes and transcripts, Minutes search, upload, download, and editing, bot participation, live meeting content, and in-meeting chat; scheduling, free/busy, and rooms belong to `lark-calendar`.
- `lark-minutes`: alias that defers to `lark-meeting`; open it only when the user or a configuration names it.
- `lark-note`: alias that defers to `lark-meeting`; open it only when the user or a configuration names it.
- `lark-okr`: Feishu OKR: view and edit cycles, objectives, key results, alignments, metrics, and progress records.
- `lark-openapi-explorer`: Feishu native OpenAPI exploration: find and call OpenAPI endpoints the CLI does not wrap when no other guide or registered command fits.
- `lark-shared`: lark-cli setup and auth: login, status, and logout, user versus bot identity, business-domain permissions, missing scopes, revoking authorization, and `_notice` JSON.
- `lark-sheets`: Feishu Sheets: create and edit spreadsheets, sheet and row or column structure, cell values, formulas, styles, charts, pivot tables, conditional formats, filters, and Excel or CSV import and export; Base belongs to `lark-base`, and searching Drive for a sheet to `lark-drive`.
- `lark-skill-maker`: create custom lark-cli skills that wrap Feishu API operations or multi-step flows.
- `lark-slides`: Feishu Slides: create presentations, read slide content, and create, delete, read, or partially replace pages; whiteboards inside documents belong to `lark-whiteboard`.
- `lark-task`: Feishu Tasks: create and update tasks and their status, subtasks, task lists, assignees, attachments, and task agents.
- `lark-vc`: alias that defers to `lark-meeting`; open it only when the user or a configuration names it.
- `lark-vc-agent`: alias that defers to `lark-meeting`; open it only when the user or a configuration names it.
- `lark-whiteboard`: Feishu whiteboards inside documents: export a whiteboard as an image or as raw nodes and update its content in several formats.
- `lark-wiki`: Feishu Wiki: knowledge spaces, their members, the node hierarchy, and organizing documents and shortcuts; use for `/wiki/` links, while document content belongs to `lark-doc`.
- `lark-workflow-meeting-summary`: workflow that collects the meeting minutes of a date range into a structured report.
- `lark-workflow-standup-report`: workflow that combines the calendar agenda and open tasks into a summary for a day or a week.
## Opening a guide
These guides belong to lark-cli and are not skills: open one with `lark-cli skills read <name>` in the Host Shell, not with the skill tool.
Read a file that a guide references, such as `references/...`, with `lark-cli skills read <name> <relative-path>`. Read a reference to another guide, such as `../lark-foo/...`, with the same command without the leading `../`: `lark-cli skills read lark-foo/...`.
+119
View File
@@ -0,0 +1,119 @@
/** Check, connection, and sign-out of the CLI's default Feishu account, as the operations `ctx.cliAccounts` runs. */
import { brandString } from '@deepseek-ai/dsh-brand'
import z from 'zod'
import type { CliOperationControl } from '@deepseek-ai/dsh-cli-account/types'
import { assertNever } from '@deepseek-ai/dsh-util-values'
import { parseJson } from './cli.ts'
import type { FeishuAccountState, FeishuAppId, FeishuCommand, FeishuOperationKind, FeishuPhase } from './types.ts'
const NotConfigured = z.object({ ok: z.literal(false), error: z.object({ subtype: z.literal('not_configured') }) })
const User = z.object({
status: z.string(),
available: z.boolean(),
verified: z.boolean().optional(),
userName: z.string().optional(),
openId: z.string().optional(),
})
const Status = z.object({ appId: z.string().min(1), identities: z.object({ user: User }) })
const LoginLink = z.object({ event: z.literal('device_authorization'), verification_uri_complete: z.string() })
const LoginComplete = z.object({ event: z.literal('authorization_complete'), user_open_id: z.string().min(1), missing: z.array(z.string()) })
const CONFIG_LINK = /^\s*(https:\/\/\S+)\s*$/u
const SIGNED_OUT = new Set(['missing', 'not_configured', 'needs_refresh'])
type Control = CliOperationControl<FeishuAccountState, FeishuPhase, FeishuCommand>
interface Check { account: FeishuAccountState; openId?: string | undefined }
/**
* Carry out one account operation with lark-cli and publish the account each check observes.
* @param kind - the requested operation.
* @param control - phase changes, link offers, command runs, and account updates for this operation.
* @param signal - aborts on cancellation and when the plugin unloads.
* @returns after the operation finishes.
* @throws when a command fails, its output is not the expected JSON, or the account it leaves is not the one the
* operation set out to reach.
*/
export async function perform(kind: FeishuOperationKind, control: Control, signal: AbortSignal): Promise<void> {
switch (kind) {
case 'check':
await check(control, signal)
return
case 'link-app': return linkApp(control, signal)
case 'sign-in': return signIn(control, signal)
case 'sign-out': {
control.stage('signing-out')
const result = await control.run('auth-logout', ['auth', 'logout', '--json'], signal)
if (result.exitCode !== 0) throw new Error('feishu: auth logout failed')
await check(control, signal)
return
}
/* v8 ignore next -- closed operation kind union */
default: return assertNever(kind)
}
}
/**
* Link an app through the CLI's setup page; sign-in is a separate operation. An existing configuration,
* including its sign-ins and any other app, is replaced by the app the user creates or chooses.
*/
async function linkApp(control: Control, signal: AbortSignal): Promise<void> {
control.stage('configuring')
let offered = false
const setup = await control.run('config-init', ['config', 'init', '--new'], signal, {
awaitsUser: true,
onLine: (stream, line) => {
const link = stream === 'stderr' && !offered ? CONFIG_LINK.exec(line) : null
if (link !== null) offered = control.offer(link[1] as string)
},
})
if (setup.exitCode !== 0) throw new Error('feishu: config init failed')
control.stage('checking')
if ((await check(control, signal)).account.state === 'unconfigured') throw new Error('feishu: config init left no app')
}
/** Sign the configured app's user in, then confirm the CLI's default account is that user. */
async function signIn(control: Control, signal: AbortSignal): Promise<void> {
control.stage('authorizing')
let complete: z.infer<typeof LoginComplete> | undefined
const login = await control.run('auth-login', ['auth', 'login', '--json'], signal, {
awaitsUser: true,
onLine: (stream, line) => {
if (stream !== 'stdout' || !line.startsWith('{')) return
const event: unknown = JSON.parse(line)
const link = LoginLink.safeParse(event)
if (link.success) control.offer(link.data.verification_uri_complete)
const done = LoginComplete.safeParse(event)
if (done.success) complete = done.data
},
})
// Exit code 3 reports a sign-in that completed without every requested permission.
if (complete === undefined || (login.exitCode !== 0 && !(login.exitCode === 3 && complete.missing.length > 0))) {
throw new Error('feishu: auth login did not complete')
}
control.stage('verifying')
const found = await check(control, signal)
if (found.account.state !== 'connected' || found.openId !== complete.user_open_id) throw new Error('feishu: sign-in did not verify')
}
/** Read the default account, publish what it shows, and return it with the signed-in user's id. */
async function check(control: Control, signal: AbortSignal): Promise<Check> {
const args = ['auth', 'status', '--verify', '--json']
const result = await control.run('auth-status', args, signal)
if (result.exitCode !== 0) {
if (!NotConfigured.safeParse(parseJson(args, result.stderr)).success) throw new Error('feishu: auth status failed')
return record(control, { state: 'unconfigured' })
}
const status = Status.parse(parseJson(args, result.stdout))
const appId = brandString<FeishuAppId>(status.appId)
const user = status.identities.user
const account: FeishuAccountState = user.available && user.verified === true
? { state: 'connected', appId, ...user.userName === undefined ? {} : { userName: user.userName } }
: { state: SIGNED_OUT.has(user.status) ? 'signed-out' : 'unverified', appId }
return record(control, account, user.openId)
}
function record(control: Control, account: FeishuAccountState, openId?: string): Check {
control.publish(account)
return { account, openId }
}
+48
View File
@@ -0,0 +1,48 @@
/** Managed lark-cli location and the JSON output of its commands. */
import { accessSync, constants } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
/** The name lark-cli's guides run it by. */
export const PROGRAM = 'lark-cli'
/**
* Name the executable file as `@larksuite/cli` installs it.
* @param platform - the Host platform.
* @returns `lark-cli`, or `lark-cli.exe` on Windows.
*/
export function executableFileName(platform: NodeJS.Platform): string {
return platform === 'win32' ? `${PROGRAM}.exe` : PROGRAM
}
/**
* Locate the managed executable.
* @param binDir - absolute override; defaults to the installed `@larksuite/cli` package.
* @returns the absolute path of the executable `lark-cli`, `lark-cli.exe` on Windows.
* @throws when the executable is missing.
*/
export function resolveCliExecutable(binDir: string | undefined): string {
const program = join(binDir ?? join(dirname(fileURLToPath(import.meta.resolve('@larksuite/cli/package.json'))), 'bin'), executableFileName(process.platform))
try {
accessSync(program, constants.X_OK)
} catch (error) {
throw new Error(`feishu: ${program} is not executable; approve the @larksuite/cli install script or set binDir`, { cause: error })
}
return program
}
/**
* Parse one command's JSON output.
* @param args - the command's native arguments, for the error message.
* @param output - the complete stream the command wrote the JSON to.
* @returns unvalidated JSON for the caller to check.
* @throws when the output is not JSON.
*/
export function parseJson(args: readonly string[], output: string): unknown {
try {
return JSON.parse(output)
} catch (error) {
throw new Error(`${[PROGRAM, ...args].join(' ')} returned invalid JSON`, { cause: error })
}
}
+62
View File
@@ -0,0 +1,62 @@
/**
* Feishu plugin: registers the managed lark-cli and its account with `ctx.cliAccounts`, which tells the model the CLI's
* absolute path and shows the account on the Plugins page, and lists the packaged `feishu` skill that indexes the
* guides embedded in that CLI. The CLI's default account is shared with the user's own terminal.
* @module @deepseek-ai/dsh-feishu
*/
import { fileURLToPath } from 'node:url'
import type { Context } from '@deepseek-ai/cordis'
import z from '@deepseek-ai/schemastery'
import type {} from '@deepseek-ai/dsh-cli-account'
import type {} from '@deepseek-ai/dsh-skill'
import { perform } from './account.ts'
import { PROGRAM, resolveCliExecutable } from './cli.ts'
import { dictionaries, type FeishuTextKey } from './locales.ts'
import { copy, FEISHU_PACKAGE, operations, presentAccount } from './presentation.ts'
import { FeishuSkillProvider } from './skills.ts'
import type { FeishuAccountState, FeishuCommand, FeishuOperationKind, FeishuPhase } from './types.ts'
/** Plugin name. */
export const name = 'feishu'
/** Services the CLI's account and its skill register with. */
export const inject = ['cliAccounts', 'skills']
/** The packaged entry skill; the guides it indexes stay in the CLI. */
const ENTRY = fileURLToPath(new URL('../skills/feishu/SKILL.md', import.meta.url))
/** Where lark-cli is. */
export interface Config {
/** Absolute directory holding the `lark-cli` executable; defaults to the installed `@larksuite/cli` package. */
binDir?: string
}
/** Validates {@link Config}. */
export const Config: z<Config> = z.object({
binDir: z.string().min(1),
})
/**
* Register the CLI with its account, and the skill.
* @param ctx - Context carrying the CLI account Service and the skill registry.
* @param config - CLI location.
* @throws when `lark-cli` is not executable, or the packaged entry skill has no name or description.
*/
export function apply(ctx: Context, config: Config): void {
ctx.cliAccounts.register<FeishuAccountState, FeishuOperationKind, FeishuPhase, FeishuCommand, FeishuTextKey>({
name,
packageName: FEISHU_PACKAGE,
cli: { product: 'Feishu', program: PROGRAM, executable: resolveCliExecutable(config.binDir) },
account: { state: 'unchecked' },
check: 'check',
cancellable: ['configuring', 'authorizing'],
authorizationHosts: ['feishu.cn', 'larksuite.com'],
perform,
dictionaries,
operations,
copy,
present: presentAccount,
})
ctx.skills.registerProvider(() => new FeishuSkillProvider(ENTRY))
}
+367
View File
@@ -0,0 +1,367 @@
/** The Feishu text the Plugins page shows; the browser resolves it in its active language. */
/** Chinese dictionary and key source. */
export const zh = {
'section.title': '飞书账号',
'status.checking': '正在检查连接',
'status.disconnected': '未连接',
'status.unavailable': '暂时无法确认登录状态',
'status.connected': '已连接',
'step.configuring': '第 1 步:关联飞书应用',
'step.authorizing': '第 2 步:登录飞书账号',
'step.connecting': '正在连接',
'step.signing-out': '正在退出登录',
'detail.no-app': '先关联一个飞书应用(可以新建,也可以选择已有应用),再登录飞书账号。连接后,可以在对话中使用飞书文档、消息及其他你授权的功能。',
'detail.signed-out': '已关联飞书应用。登录飞书账号后,就可以在对话中使用飞书。',
'detail.unavailable': '已保留现有配置和登录,可以稍后重试。',
'detail.connected': '可以在对话中直接请 Agent 使用飞书。',
'detail.connectedAs': '已登录为 {name}。可以在对话中直接请 Agent 使用飞书。',
'detail.configuring': '在打开的飞书页面中新建或选择应用,完成后回到这里登录。页面没有打开时,点击“打开飞书页面”。',
'detail.authorizing': '在打开的飞书页面中确认授权,完成后回到这里查看结果。页面没有打开时,点击“打开飞书页面”。',
hint: '飞书账号与这台电脑终端里的飞书 CLI 共用。',
'app.linked': '飞书应用:{id}',
failed: '操作未完成,请重试',
'failed.linkApp': '飞书应用关联未完成。若飞书页面已显示成功,请检查 DSH 对本机配置与系统凭据的访问权限,再次关联时请选择已有应用',
'action.connect': '连接飞书',
'action.linkApp': '关联飞书应用',
'action.signIn': '登录飞书账号',
'action.open': '打开飞书页面',
'action.cancel': '取消',
'action.signOut': '退出登录',
'action.replaceApp': '更换应用',
'action.retry': '重试',
'badge.connected': '已连接',
'badge.disconnected': '未连接',
'badge.connecting': '连接中',
'badge.unavailable': '待确认',
'signOut.title': '退出飞书登录?',
'signOut.body': '将退出飞书 CLI 的默认账号,这台电脑终端里的 lark-cli 也会一起退出。已关联的飞书应用会保留。',
'replaceApp.title': '更换飞书应用?',
'replaceApp.body': '将打开飞书页面,新建或选择一个应用。这台电脑上飞书 CLI 的配置会替换为这个应用,终端里的 lark-cli 也一样;更换后需要重新登录飞书账号。',
'activation.title': '连接飞书账号',
'activation.body': '飞书插件已开启。连接你的飞书账号后,就可以在对话中使用它。',
'notice.app-linked': '飞书应用已关联,下一步登录飞书账号',
'notice.connected': '飞书已连接',
'notice.signed-out': '已退出飞书登录',
}
/** Every key of the Feishu text. */
export type FeishuTextKey = keyof typeof zh
/** English dictionary. */
export const en: Record<FeishuTextKey, string> = {
'section.title': 'Feishu account',
'status.checking': 'Checking connection',
'status.disconnected': 'Not connected',
'status.unavailable': 'Cannot confirm sign-in right now',
'status.connected': 'Connected',
'step.configuring': 'Step 1: Link a Feishu app',
'step.authorizing': 'Step 2: Sign in to Feishu',
'step.connecting': 'Connecting',
'step.signing-out': 'Signing out',
'detail.no-app': 'Link a Feishu app first, either a new one or one you already have, then sign in to Feishu. After that, you can use Feishu docs, messages, and other features you authorize in conversations.',
'detail.signed-out': 'A Feishu app is linked. Sign in to Feishu to use it in conversations.',
'detail.unavailable': 'The existing setup and sign-in are kept. Try again later.',
'detail.connected': 'Ask the agent to use Feishu directly in a conversation.',
'detail.connectedAs': 'Signed in as {name}. Ask the agent to use Feishu directly in a conversation.',
'detail.configuring': 'Create or choose an app on the Feishu page, then come back here to sign in. If the page did not open, select Open Feishu page.',
'detail.authorizing': 'Confirm the authorization on the Feishu page, then come back here to see the result. If the page did not open, select Open Feishu page.',
hint: 'The Feishu account is shared with the Feishu CLI in this computer\'s terminal.',
'app.linked': 'Feishu app: {id}',
failed: 'The action did not finish. Try again.',
'failed.linkApp': 'Feishu app linking did not finish. If the Feishu page reported success, check DSH access to local configuration and system credentials, then choose the existing app when linking again.',
'action.connect': 'Connect Feishu',
'action.linkApp': 'Link Feishu app',
'action.signIn': 'Sign in to Feishu',
'action.open': 'Open Feishu page',
'action.cancel': 'Cancel',
'action.signOut': 'Sign out',
'action.replaceApp': 'Change app',
'action.retry': 'Retry',
'badge.connected': 'Connected',
'badge.disconnected': 'Not connected',
'badge.connecting': 'Connecting',
'badge.unavailable': 'Unconfirmed',
'signOut.title': 'Sign out of Feishu?',
'signOut.body': 'This signs out the Feishu CLI\'s default account, including lark-cli in this computer\'s terminal. The linked Feishu app is kept.',
'replaceApp.title': 'Change the Feishu app?',
'replaceApp.body': 'A Feishu page opens where you create or choose an app. The Feishu CLI on this computer, including lark-cli in its terminal, is then configured with that app only, and you sign in to Feishu again.',
'activation.title': 'Connect your Feishu account',
'activation.body': 'The Feishu plugin is on. Connect your Feishu account to use it in conversations.',
'notice.app-linked': 'Feishu app linked. Next, sign in to Feishu.',
'notice.connected': 'Feishu connected',
'notice.signed-out': 'Signed out of Feishu',
}
/** Japanese dictionary. */
export const ja: Record<FeishuTextKey, string> = {
'section.title': 'Feishu アカウント',
'status.checking': '接続を確認中',
'status.disconnected': '未接続',
'status.unavailable': '現在サインイン状態を確認できません',
'status.connected': '接続済み',
'step.configuring': 'ステップ 1:Feishu アプリを関連付ける',
'step.authorizing': 'ステップ 2:Feishu にサインイン',
'step.connecting': '接続中',
'step.signing-out': 'サインアウト中',
'detail.no-app': 'まず Feishu アプリを関連付け(新規作成または既存のアプリを選択)、次に Feishu にサインインしてください。その後、会話の中で Feishu のドキュメント、メッセージ、その他の承認した機能を使用できます。',
'detail.signed-out': 'Feishu アプリは関連付け済みです。Feishu にサインインすると、会話の中で使用できます。',
'detail.unavailable': '現在の設定とサインイン状態は保持されています。しばらくしてから再試行してください。',
'detail.connected': '会話の中でエージェントに Feishu の使用を直接依頼できます。',
'detail.connectedAs': '{name} としてサインインしています。会話の中でエージェントに Feishu の使用を直接依頼できます。',
'detail.configuring': '開いた Feishu ページでアプリを作成または選択し、完了したらここに戻ってサインインしてください。ページが開かない場合は、「Feishu ページを開く」を選択してください。',
'detail.authorizing': '開いた Feishu ページで認可を確定し、完了したらここに戻って結果を確認してください。ページが開かない場合は、「Feishu ページを開く」を選択してください。',
hint: 'Feishu アカウントは、このコンピューターのターミナルにある Feishu CLI と共有されます。',
'app.linked': 'Feishu アプリ:{id}',
failed: '操作が完了しませんでした。もう一度お試しください。',
'failed.linkApp': 'Feishu アプリの関連付けが完了しませんでした。Feishu ページに成功と表示された場合は、DSH がローカル設定とシステムの認証情報にアクセスできるか確認し、再度関連付けるときは既存のアプリを選択してください。',
'action.connect': 'Feishu を接続',
'action.linkApp': 'Feishu アプリを関連付ける',
'action.signIn': 'Feishu にサインイン',
'action.open': 'Feishu ページを開く',
'action.cancel': 'キャンセル',
'action.signOut': 'サインアウト',
'action.replaceApp': 'アプリを変更',
'action.retry': '再試行',
'badge.connected': '接続済み',
'badge.disconnected': '未接続',
'badge.connecting': '接続中',
'badge.unavailable': '未確認',
'signOut.title': 'Feishu からサインアウトしますか?',
'signOut.body': 'Feishu CLI の既定のアカウントからサインアウトします。このコンピューターのターミナルにある lark-cli もサインアウトされます。関連付けた Feishu アプリは保持されます。',
'replaceApp.title': 'Feishu アプリを変更しますか?',
'replaceApp.body': 'Feishu ページが開くので、アプリを作成または選択します。このコンピューターの Feishu CLI(ターミナルの lark-cli を含む)の設定はそのアプリに置き換わり、Feishu に再度サインインする必要があります。',
'activation.title': 'Feishu アカウントを接続',
'activation.body': 'Feishu プラグインがオンになりました。Feishu アカウントを接続すると、会話の中で使用できます。',
'notice.app-linked': 'Feishu アプリを関連付けました。次に Feishu にサインインしてください。',
'notice.connected': 'Feishu を接続しました',
'notice.signed-out': 'Feishu からサインアウトしました',
}
/** Spanish dictionary. */
export const es: Record<FeishuTextKey, string> = {
'section.title': 'Cuenta de Feishu',
'status.checking': 'Comprobando la conexión',
'status.disconnected': 'No conectado',
'status.unavailable': 'No se puede confirmar el inicio de sesión en este momento',
'status.connected': 'Conectado',
'step.configuring': 'Paso 1: vincule una aplicación de Feishu',
'step.authorizing': 'Paso 2: inicie sesión en Feishu',
'step.connecting': 'Conectando',
'step.signing-out': 'Cerrando sesión',
'detail.no-app': 'Primero vincule una aplicación de Feishu, ya sea nueva o una que ya tenga, y luego inicie sesión en Feishu. Después, podrá usar en las conversaciones los documentos, los mensajes y otras funciones de Feishu que autorice.',
'detail.signed-out': 'Hay una aplicación de Feishu vinculada. Inicie sesión en Feishu para usarlo en las conversaciones.',
'detail.unavailable': 'Se conservan la configuración y el inicio de sesión actuales. Inténtelo de nuevo más tarde.',
'detail.connected': 'Pida al agente que use Feishu directamente en una conversación.',
'detail.connectedAs': 'Sesión iniciada como {name}. Pida al agente que use Feishu directamente en una conversación.',
'detail.configuring': 'Cree o elija una aplicación en la página de Feishu y luego vuelva aquí para iniciar sesión. Si la página no se abrió, seleccione “Abrir página de Feishu”.',
'detail.authorizing': 'Confirme la autorización en la página de Feishu y luego vuelva aquí para ver el resultado. Si la página no se abrió, seleccione “Abrir página de Feishu”.',
hint: 'La cuenta de Feishu se comparte con la CLI de Feishu en la terminal de esta computadora.',
'app.linked': 'Aplicación de Feishu: {id}',
failed: 'La acción no se completó. Inténtelo de nuevo.',
'failed.linkApp': 'La vinculación de la aplicación de Feishu no se completó. Si la página de Feishu indicó que se realizó correctamente, compruebe el acceso de DSH a la configuración local y a las credenciales del sistema y, al volver a vincular, elija la aplicación existente.',
'action.connect': 'Conectar Feishu',
'action.linkApp': 'Vincular aplicación de Feishu',
'action.signIn': 'Iniciar sesión en Feishu',
'action.open': 'Abrir página de Feishu',
'action.cancel': 'Cancelar',
'action.signOut': 'Cerrar sesión',
'action.replaceApp': 'Cambiar aplicación',
'action.retry': 'Reintentar',
'badge.connected': 'Conectado',
'badge.disconnected': 'No conectado',
'badge.connecting': 'Conectando',
'badge.unavailable': 'Sin confirmar',
'signOut.title': '¿Cerrar sesión en Feishu?',
'signOut.body': 'Se cerrará la sesión de la cuenta predeterminada de la CLI de Feishu, incluido lark-cli en la terminal de esta computadora. La aplicación de Feishu vinculada se conserva.',
'replaceApp.title': '¿Cambiar la aplicación de Feishu?',
'replaceApp.body': 'Se abrirá una página de Feishu donde podrá crear o elegir una aplicación. Después, la CLI de Feishu de esta computadora, incluido lark-cli en su terminal, quedará configurada solo con esa aplicación y deberá volver a iniciar sesión en Feishu.',
'activation.title': 'Conecte su cuenta de Feishu',
'activation.body': 'El complemento de Feishu está activado. Conecte su cuenta de Feishu para usarlo en las conversaciones.',
'notice.app-linked': 'Aplicación de Feishu vinculada. Ahora inicie sesión en Feishu.',
'notice.connected': 'Feishu conectado',
'notice.signed-out': 'Sesión de Feishu cerrada',
}
/** French dictionary. */
export const fr: Record<FeishuTextKey, string> = {
'section.title': 'Compte Feishu',
'status.checking': 'Vérification de la connexion',
'status.disconnected': 'Non connecté',
'status.unavailable': 'Impossible de confirmer la connexion pour le moment',
'status.connected': 'Connecté',
'step.configuring': 'Étape 1 : associez une application Feishu',
'step.authorizing': 'Étape 2 : connectez-vous à Feishu',
'step.connecting': 'Connexion en cours',
'step.signing-out': 'Déconnexion en cours',
'detail.no-app': 'Associez d’abord une application Feishu, nouvelle ou existante, puis connectez-vous à Feishu. Vous pourrez ensuite utiliser dans les conversations les documents, les messages et les autres fonctionnalités de Feishu que vous autorisez.',
'detail.signed-out': 'Une application Feishu est associée. Connectez-vous à Feishu pour l’utiliser dans les conversations.',
'detail.unavailable': 'La configuration et la connexion existantes sont conservées. Réessayez plus tard.',
'detail.connected': 'Demandez à l’agent d’utiliser Feishu directement dans une conversation.',
'detail.connectedAs': 'Connecté en tant que {name}. Demandez à l’agent d’utiliser Feishu directement dans une conversation.',
'detail.configuring': 'Créez ou choisissez une application sur la page Feishu, puis revenez ici pour vous connecter. Si la page ne s’est pas ouverte, sélectionnez « Ouvrir la page Feishu ».',
'detail.authorizing': 'Confirmez l’autorisation sur la page Feishu, puis revenez ici pour voir le résultat. Si la page ne s’est pas ouverte, sélectionnez « Ouvrir la page Feishu ».',
hint: 'Le compte Feishu est partagé avec la CLI Feishu du terminal de cet ordinateur.',
'app.linked': 'Application Feishu : {id}',
failed: 'L’action n’a pas abouti. Réessayez.',
'failed.linkApp': 'L’association de l’application Feishu n’a pas abouti. Si la page Feishu a indiqué une réussite, vérifiez l’accès de DSH à la configuration locale et aux identifiants système, puis choisissez l’application existante lors de la nouvelle association.',
'action.connect': 'Connecter Feishu',
'action.linkApp': 'Associer une application Feishu',
'action.signIn': 'Se connecter à Feishu',
'action.open': 'Ouvrir la page Feishu',
'action.cancel': 'Annuler',
'action.signOut': 'Se déconnecter',
'action.replaceApp': 'Changer d’application',
'action.retry': 'Réessayer',
'badge.connected': 'Connecté',
'badge.disconnected': 'Non connecté',
'badge.connecting': 'Connexion en cours',
'badge.unavailable': 'Non confirmé',
'signOut.title': 'Se déconnecter de Feishu ?',
'signOut.body': 'Cela déconnecte le compte par défaut de la CLI Feishu, y compris lark-cli dans le terminal de cet ordinateur. L’application Feishu associée est conservée.',
'replaceApp.title': 'Changer l’application Feishu ?',
'replaceApp.body': 'Une page Feishu s’ouvre pour créer ou choisir une application. La CLI Feishu de cet ordinateur, y compris lark-cli dans son terminal, est ensuite configurée avec cette seule application, et vous devez vous reconnecter à Feishu.',
'activation.title': 'Connectez votre compte Feishu',
'activation.body': 'Le plugin Feishu est activé. Connectez votre compte Feishu pour l’utiliser dans les conversations.',
'notice.app-linked': 'Application Feishu associée. Connectez-vous maintenant à Feishu.',
'notice.connected': 'Feishu connecté',
'notice.signed-out': 'Déconnecté de Feishu',
}
/** German dictionary. */
export const de: Record<FeishuTextKey, string> = {
'section.title': 'Feishu-Konto',
'status.checking': 'Verbindung wird geprüft',
'status.disconnected': 'Nicht verbunden',
'status.unavailable': 'Anmeldung kann gerade nicht bestätigt werden',
'status.connected': 'Verbunden',
'step.configuring': 'Schritt 1: Feishu-App verknüpfen',
'step.authorizing': 'Schritt 2: Bei Feishu anmelden',
'step.connecting': 'Wird verbunden',
'step.signing-out': 'Wird abgemeldet',
'detail.no-app': 'Verknüpfen Sie zuerst eine Feishu-App, entweder eine neue oder eine vorhandene, und melden Sie sich dann bei Feishu an. Danach können Sie Dokumente, Nachrichten und weitere von Ihnen autorisierte Funktionen von Feishu in Unterhaltungen verwenden.',
'detail.signed-out': 'Eine Feishu-App ist verknüpft. Melden Sie sich bei Feishu an, um es in Unterhaltungen zu verwenden.',
'detail.unavailable': 'Die bestehende Einrichtung und Anmeldung bleiben erhalten. Versuchen Sie es später erneut.',
'detail.connected': 'Bitten Sie den Agenten, Feishu direkt in einer Unterhaltung zu verwenden.',
'detail.connectedAs': 'Angemeldet als {name}. Bitten Sie den Agenten, Feishu direkt in einer Unterhaltung zu verwenden.',
'detail.configuring': 'Erstellen oder wählen Sie auf der Feishu-Seite eine App und kehren Sie dann hierher zurück, um sich anzumelden. Falls sich die Seite nicht geöffnet hat, wählen Sie „Feishu-Seite öffnen“.',
'detail.authorizing': 'Bestätigen Sie die Autorisierung auf der Feishu-Seite und kehren Sie dann hierher zurück, um das Ergebnis zu sehen. Falls sich die Seite nicht geöffnet hat, wählen Sie „Feishu-Seite öffnen“.',
hint: 'Das Feishu-Konto wird mit der Feishu-CLI im Terminal dieses Computers geteilt.',
'app.linked': 'Feishu-App: {id}',
failed: 'Die Aktion wurde nicht abgeschlossen. Versuchen Sie es erneut.',
'failed.linkApp': 'Die Verknüpfung der Feishu-App wurde nicht abgeschlossen. Wenn die Feishu-Seite einen Erfolg gemeldet hat, prüfen Sie den Zugriff von DSH auf die lokale Konfiguration und die Systemanmeldedaten und wählen Sie beim erneuten Verknüpfen die vorhandene App.',
'action.connect': 'Feishu verbinden',
'action.linkApp': 'Feishu-App verknüpfen',
'action.signIn': 'Bei Feishu anmelden',
'action.open': 'Feishu-Seite öffnen',
'action.cancel': 'Abbrechen',
'action.signOut': 'Abmelden',
'action.replaceApp': 'App wechseln',
'action.retry': 'Erneut versuchen',
'badge.connected': 'Verbunden',
'badge.disconnected': 'Nicht verbunden',
'badge.connecting': 'Wird verbunden',
'badge.unavailable': 'Unbestätigt',
'signOut.title': 'Von Feishu abmelden?',
'signOut.body': 'Dadurch wird das Standardkonto der Feishu-CLI abgemeldet, auch für lark-cli im Terminal dieses Computers. Die verknüpfte Feishu-App bleibt erhalten.',
'replaceApp.title': 'Feishu-App wechseln?',
'replaceApp.body': 'Es öffnet sich eine Feishu-Seite, auf der Sie eine App erstellen oder wählen. Anschließend ist die Feishu-CLI auf diesem Computer, einschließlich lark-cli im Terminal, nur noch mit dieser App konfiguriert, und Sie melden sich erneut bei Feishu an.',
'activation.title': 'Feishu-Konto verbinden',
'activation.body': 'Das Feishu-Plugin ist aktiviert. Verbinden Sie Ihr Feishu-Konto, um es in Unterhaltungen zu verwenden.',
'notice.app-linked': 'Feishu-App verknüpft. Melden Sie sich als Nächstes bei Feishu an.',
'notice.connected': 'Feishu verbunden',
'notice.signed-out': 'Von Feishu abgemeldet',
}
/** Russian dictionary. */
export const ru: Record<FeishuTextKey, string> = {
'section.title': 'Аккаунт Feishu',
'status.checking': 'Проверка подключения',
'status.disconnected': 'Не подключено',
'status.unavailable': 'Сейчас не удаётся подтвердить вход',
'status.connected': 'Подключено',
'step.configuring': 'Шаг 1. Привяжите приложение Feishu',
'step.authorizing': 'Шаг 2. Войдите в Feishu',
'step.connecting': 'Подключение',
'step.signing-out': 'Выполняется выход',
'detail.no-app': 'Сначала привяжите приложение Feishu — новое или уже существующее, — затем войдите в Feishu. После этого в беседах можно будет использовать документы, сообщения и другие разрешённые вами функции Feishu.',
'detail.signed-out': 'Приложение Feishu привязано. Войдите в Feishu, чтобы использовать его в беседах.',
'detail.unavailable': 'Текущие настройки и вход сохранены. Повторите попытку позже.',
'detail.connected': 'Попросите агента использовать Feishu прямо в беседе.',
'detail.connectedAs': 'Выполнен вход как {name}. Попросите агента использовать Feishu прямо в беседе.',
'detail.configuring': 'Создайте или выберите приложение на странице Feishu, затем вернитесь сюда, чтобы войти. Если страница не открылась, нажмите «Открыть страницу Feishu».',
'detail.authorizing': 'Подтвердите авторизацию на странице Feishu, затем вернитесь сюда, чтобы увидеть результат. Если страница не открылась, нажмите «Открыть страницу Feishu».',
hint: 'Аккаунт Feishu общий с Feishu CLI в терминале этого компьютера.',
'app.linked': 'Приложение Feishu: {id}',
failed: 'Действие не завершено. Повторите попытку.',
'failed.linkApp': 'Привязка приложения Feishu не завершена. Если страница Feishu сообщила об успехе, проверьте доступ DSH к локальной конфигурации и системным учётным данным, а при повторной привязке выберите уже существующее приложение.',
'action.connect': 'Подключить Feishu',
'action.linkApp': 'Привязать приложение Feishu',
'action.signIn': 'Войти в Feishu',
'action.open': 'Открыть страницу Feishu',
'action.cancel': 'Отмена',
'action.signOut': 'Выйти',
'action.replaceApp': 'Сменить приложение',
'action.retry': 'Повторить',
'badge.connected': 'Подключено',
'badge.disconnected': 'Не подключено',
'badge.connecting': 'Подключение',
'badge.unavailable': 'Не подтверждено',
'signOut.title': 'Выйти из Feishu?',
'signOut.body': 'Будет выполнен выход из аккаунта Feishu CLI по умолчанию, в том числе для lark-cli в терминале этого компьютера. Привязанное приложение Feishu сохранится.',
'replaceApp.title': 'Сменить приложение Feishu?',
'replaceApp.body': 'Откроется страница Feishu, где можно создать или выбрать приложение. После этого Feishu CLI на этом компьютере, включая lark-cli в терминале, будет настроен только на это приложение, и потребуется снова войти в Feishu.',
'activation.title': 'Подключите аккаунт Feishu',
'activation.body': 'Плагин Feishu включён. Подключите аккаунт Feishu, чтобы использовать его в беседах.',
'notice.app-linked': 'Приложение Feishu привязано. Теперь войдите в Feishu.',
'notice.connected': 'Feishu подключён',
'notice.signed-out': 'Выполнен выход из Feishu',
}
/** Portuguese dictionary. */
export const pt: Record<FeishuTextKey, string> = {
'section.title': 'Conta do Feishu',
'status.checking': 'Verificando a conexão',
'status.disconnected': 'Não conectado',
'status.unavailable': 'Não é possível confirmar o login no momento',
'status.connected': 'Conectado',
'step.configuring': 'Etapa 1: vincule um app do Feishu',
'step.authorizing': 'Etapa 2: entre no Feishu',
'step.connecting': 'Conectando',
'step.signing-out': 'Saindo',
'detail.no-app': 'Primeiro vincule um app do Feishu, novo ou já existente, e depois entre no Feishu. Em seguida, você poderá usar nas conversas os documentos, as mensagens e outros recursos do Feishu que autorizar.',
'detail.signed-out': 'Há um app do Feishu vinculado. Entre no Feishu para usá-lo nas conversas.',
'detail.unavailable': 'A configuração e o login atuais foram mantidos. Tente novamente mais tarde.',
'detail.connected': 'Peça ao agente que use o Feishu diretamente em uma conversa.',
'detail.connectedAs': 'Conectado como {name}. Peça ao agente que use o Feishu diretamente em uma conversa.',
'detail.configuring': 'Crie ou escolha um app na página do Feishu e depois volte aqui para entrar. Se a página não abriu, selecione “Abrir página do Feishu”.',
'detail.authorizing': 'Confirme a autorização na página do Feishu e depois volte aqui para ver o resultado. Se a página não abriu, selecione “Abrir página do Feishu”.',
hint: 'A conta do Feishu é compartilhada com a CLI do Feishu no terminal deste computador.',
'app.linked': 'App do Feishu: {id}',
failed: 'A ação não foi concluída. Tente novamente.',
'failed.linkApp': 'A vinculação do app do Feishu não foi concluída. Se a página do Feishu informou sucesso, verifique o acesso do DSH à configuração local e às credenciais do sistema e, ao vincular novamente, escolha o app existente.',
'action.connect': 'Conectar Feishu',
'action.linkApp': 'Vincular app do Feishu',
'action.signIn': 'Entrar no Feishu',
'action.open': 'Abrir página do Feishu',
'action.cancel': 'Cancelar',
'action.signOut': 'Sair',
'action.replaceApp': 'Trocar app',
'action.retry': 'Tentar novamente',
'badge.connected': 'Conectado',
'badge.disconnected': 'Não conectado',
'badge.connecting': 'Conectando',
'badge.unavailable': 'Não confirmado',
'signOut.title': 'Sair do Feishu?',
'signOut.body': 'Isso encerra a sessão da conta padrão da CLI do Feishu, incluindo o lark-cli no terminal deste computador. O app do Feishu vinculado é mantido.',
'replaceApp.title': 'Trocar o app do Feishu?',
'replaceApp.body': 'Uma página do Feishu será aberta para você criar ou escolher um app. Em seguida, a CLI do Feishu neste computador, incluindo o lark-cli no terminal, passa a usar apenas esse app, e você precisa entrar no Feishu novamente.',
'activation.title': 'Conecte sua conta do Feishu',
'activation.body': 'O plugin do Feishu está ativado. Conecte sua conta do Feishu para usá-lo nas conversas.',
'notice.app-linked': 'App do Feishu vinculado. Agora entre no Feishu.',
'notice.connected': 'Feishu conectado',
'notice.signed-out': 'Você saiu do Feishu',
}
/** The dictionary of every shipped language. */
export const dictionaries = { zh, en, ja, es, fr, de, ru, pt }
@@ -0,0 +1,144 @@
/** The Feishu account section the Plugins page shows for each Host view. */
import type { CliAccountText } from '@deepseek-ai/dsh-cli-account/types'
import type {
ConnectorAccountButton, ConnectorAccountCopy, ConnectorAccountDisplay, ConnectorAccountFailure, ConnectorAccountNote,
ConnectorAccountOperation,
} from '@deepseek-ai/dsh-client-ui-connector-account/types'
import { assertNever } from '@deepseek-ai/dsh-util-values'
import type { FeishuTextKey } from './locales.ts'
import type { FeishuAppId, FeishuOperationKind, FeishuState } from './types.ts'
type Text = CliAccountText<FeishuTextKey>
/** The npm package whose bundle page carries the account section. */
export const FEISHU_PACKAGE = '@deepseek-ai/dsh-feishu'
/* jscpd:ignore-start -- CLI app plugins declare page operations, copy, and commands alike, each with its own text. */
/**
* List the operations the section's buttons start; each but a check reports a notice in the browser that started it.
* @param text - writes a key of the Feishu text in every shipped language.
* @returns the operations with their notices.
*/
export function operations(text: Text): readonly ConnectorAccountOperation<FeishuOperationKind>[] {
return [
{ kind: 'check' },
{ kind: 'link-app', notice: text('notice.app-linked') },
{ kind: 'sign-in', notice: text('notice.connected') },
{ kind: 'sign-out', notice: text('notice.signed-out') },
]
}
/**
* Write the section's title and hint, and the prompt after the bundle is switched on while disconnected.
* @param text - writes a key of the Feishu text in every shipped language.
* @returns the section's fixed text.
*/
export function copy(text: Text): ConnectorAccountCopy {
return {
title: text('section.title'),
hint: text('hint'),
activation: { title: text('activation.title'), body: text('activation.body'), connect: text('action.connect') },
}
}
const CHECK = { kind: 'start', operation: 'check' } as const
const LINK_APP = { kind: 'start', operation: 'link-app' } as const
const SIGN_IN = { kind: 'start', operation: 'sign-in' } as const
const SIGN_OUT = { kind: 'start', operation: 'sign-out' } as const
/* jscpd:ignore-end */
type Operation = NonNullable<FeishuState['operation']>
type Step = 'step.configuring' | 'step.authorizing' | 'step.connecting' | 'step.signing-out'
function step(operation: Operation): Step {
if (operation.kind === 'sign-out') return 'step.signing-out'
switch (operation.phase) {
case 'configuring': return 'step.configuring'
case 'authorizing': return 'step.authorizing'
case 'signing-out': return 'step.signing-out'
case 'checking':
case 'verifying':
case 'cancelling': return 'step.connecting'
/* v8 ignore next -- closed operation phase union */
default: return assertNever(operation.phase)
}
}
/** The section while an operation runs: its step, the Feishu page and its guidance while waiting there, and cancel. */
function presentOperation(operation: Operation, text: Text): ConnectorAccountDisplay {
const current = step(operation)
const buttons: ConnectorAccountButton[] = []
if (operation.authorizationUrl !== undefined) buttons.push({ label: text('action.open'), command: { kind: 'open' }, variant: 'primary' })
if (operation.cancellable) buttons.push({ label: text('action.cancel'), command: { kind: 'cancel' }, variant: 'ghost' })
const guidance = operation.authorizationUrl === undefined ? undefined
: current === 'step.configuring' ? text('detail.configuring')
: current === 'step.authorizing' ? text('detail.authorizing') : undefined
return {
phase: 'connecting', status: text(current), badge: text('badge.connecting'), buttons, notes: [],
...guidance === undefined ? {} : { detail: guidance },
}
}
/** The row that names the linked app and replaces it after a confirmation. */
function appNotes(appId: FeishuAppId, text: Text): ConnectorAccountNote[] {
return [{
text: text('app.linked', { id: appId }),
button: {
label: text('action.replaceApp'), command: LINK_APP, variant: 'ghost',
confirm: { title: text('replaceApp.title'), body: text('replaceApp.body'), label: text('action.replaceApp') },
},
}]
}
/** The last failed operation's guidance; the Service adds the command and exit code. */
function failureOf(result: FeishuState['result'], text: Text): { failure?: ConnectorAccountFailure } {
if (result?.outcome !== 'failed') return {}
return { failure: { text: text(result.kind === 'link-app' ? 'failed.linkApp' : 'failed') } }
}
/**
* The account section for one Host view.
* @param view - the CLI's default account, the operation in progress, and the last result.
* @param text - writes a key of the Feishu text in every shipped language.
* @returns the phase, status, tag, buttons, detail, linked-app row, and failure guidance.
*/
export function presentAccount(view: FeishuState, text: Text): ConnectorAccountDisplay {
const { account, operation } = view
if (operation?.kind === 'check') return { phase: 'checking', status: text('status.checking'), buttons: [], notes: [] }
if (operation !== undefined) return presentOperation(operation, text)
const failure = failureOf(view.result, text)
switch (account.state) {
case 'unchecked': return { phase: 'checking', status: text('status.checking'), buttons: [], notes: [] }
case 'unconfigured':
return {
phase: 'disconnected', status: text('status.disconnected'), badge: text('badge.disconnected'),
buttons: [{ label: text('action.linkApp'), command: LINK_APP, variant: 'primary' }], connect: LINK_APP,
detail: text('detail.no-app'), notes: [], ...failure,
}
case 'signed-out':
return {
phase: 'disconnected', status: text('status.disconnected'), badge: text('badge.disconnected'),
buttons: [{ label: text('action.signIn'), command: SIGN_IN, variant: 'primary' }], connect: SIGN_IN,
detail: text('detail.signed-out'), notes: appNotes(account.appId, text), ...failure,
}
case 'unverified':
return {
phase: 'unavailable', status: text('status.unavailable'), badge: text('badge.unavailable'),
buttons: [{ label: text('action.retry'), command: CHECK }], detail: text('detail.unavailable'), notes: appNotes(account.appId, text), ...failure,
}
/* jscpd:ignore-start -- CLI app plugins that sign out offer the same confirmed sign-out button. */
case 'connected':
return {
phase: 'connected', status: text('status.connected'), badge: text('badge.connected'),
buttons: [{
label: text('action.signOut'), command: SIGN_OUT,
confirm: { title: text('signOut.title'), body: text('signOut.body'), label: text('action.signOut') },
}],
detail: account.userName === undefined ? text('detail.connected') : text('detail.connectedAs', { name: account.userName }),
notes: appNotes(account.appId, text), ...failure,
}
/* jscpd:ignore-end */
/* v8 ignore next -- closed account state union */
default: return assertNever(account)
}
}
+51
View File
@@ -0,0 +1,51 @@
/** The packaged `feishu` entry skill: the DSH guidance, the index of the guides embedded in lark-cli, and how to open them. */
import { readFileSync } from 'node:fs'
import z from 'zod'
import { BUNDLED_SKILL_RANK, isSkillName } from '@deepseek-ai/dsh-skill'
import type { SkillCandidate, SkillDefinition, SkillProvider } from '@deepseek-ai/dsh-skill'
import { parse as parseYaml } from 'yaml'
const Frontmatter = z.object({ name: z.string().refine(isSkillName), description: z.string().min(1) })
const FRONTMATTER = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u
/** The guides are not files: the loaded entry tells the model to open them through lark-cli. */
const RESOURCES = 'Embedded lark-cli guides; open them with the skills read command given in the loaded skill.'
/** Lists the packaged entry without running lark-cli; the entry is read once, when the plugin loads. */
export class FeishuSkillProvider implements SkillProvider {
readonly name = 'feishu'
private readonly candidate: SkillCandidate
private readonly content: string
/**
* @param entry - absolute path of the packaged `SKILL.md`, whose frontmatter gives the skill's name and description.
* @throws when the entry has no YAML frontmatter, or its frontmatter has no skill name or no description.
*/
constructor(entry: string) {
const raw = readFileSync(entry, 'utf8')
const match = FRONTMATTER.exec(raw)
const block = match?.[1]
if (match === null || block === undefined) throw new Error(`feishu: ${entry} has no YAML frontmatter`)
const parsed = Frontmatter.safeParse(parseYaml(block))
if (!parsed.success) throw new Error(`feishu: ${entry} needs a skill name and a description in its frontmatter`, { cause: parsed.error })
this.content = raw.slice(match[0].length).trim()
this.candidate = {
...parsed.data,
invocation: { modelInvocable: true, userInvocable: true },
provider: this.name,
source: 'bundled',
rank: BUNDLED_SKILL_RANK,
locator: entry,
resourceBase: { kind: 'opaque', description: RESOURCES },
}
}
list(): Promise<SkillCandidate[]> {
return Promise.resolve([this.candidate])
}
get(): Promise<SkillDefinition> {
const { rank: _rank, locator: _locator, ...summary } = this.candidate
return Promise.resolve({ ...summary, content: this.content })
}
}
+25
View File
@@ -0,0 +1,25 @@
/** Credential-free Feishu account and operation views the Plugins page presenter reads. */
import type { Branded } from '@deepseek-ai/dsh-brand'
import type { CliAccountView } from '@deepseek-ai/dsh-cli-account/types'
/** The Feishu app the CLI's default configuration uses, as `auth status` reports it. */
export type FeishuAppId = Branded<'FeishuAppId'>
/** The CLI's default account as the latest check observed it. */
export type FeishuAccountState =
| { readonly state: 'unchecked' | 'unconfigured' }
| { readonly state: 'signed-out' | 'unverified'; readonly appId: FeishuAppId }
| { readonly state: 'connected'; readonly appId: FeishuAppId; readonly userName?: string }
/** The account operations the Plugins page starts. */
export type FeishuOperationKind = 'check' | 'link-app' | 'sign-in' | 'sign-out'
/** Feishu steps of an operation, besides the Service's `checking` and `cancelling`. */
export type FeishuPhase = 'configuring' | 'authorizing' | 'verifying' | 'signing-out'
/** The lark-cli commands an operation runs; a failed operation reports its last one with that command's exit code. */
export type FeishuCommand = 'config-init' | 'auth-status' | 'auth-login' | 'auth-logout'
/** The complete Feishu view the presenter reads after each change. */
export type FeishuState = CliAccountView<FeishuAccountState, FeishuOperationKind, FeishuPhase, FeishuCommand>
@@ -0,0 +1,224 @@
/** Account operations over a scripted lark-cli: checks, app linking, sign-in, sign-out, cancellation, and the Plugins page wiring. */
import { rm } from 'node:fs/promises'
import type { Context } from '@deepseek-ai/cordis'
import type { ConnectorOperationId } from '@deepseek-ai/dsh-client-ui-connector-account/types'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import * as Feishu from '../src/index.ts'
import type { FeishuAppId, FeishuOperationKind, FeishuState } from '../src/types.ts'
import { createHost, type CliReply, type FeishuPage, type ScriptedProcess, type ScriptedSubprocess } from './harness.ts'
const APP = 'cli_a' as FeishuAppId
const STATUS = 'auth status --verify --json'
const NOT_CONFIGURED: CliReply = { exitCode: 3, stderr: JSON.stringify({ ok: false, error: { type: 'config', subtype: 'not_configured', message: 'not configured' } }) }
const status = (user: Record<string, unknown>): CliReply => ({ stdout: JSON.stringify({ appId: APP, identities: { user } }) })
const CONNECTED = status({ status: 'ready', available: true, verified: true, userName: '张三', openId: 'ou_1' })
const SIGNED_OUT = status({ status: 'missing', available: false })
const LOGIN_LINK = JSON.stringify({ event: 'device_authorization', verification_uri_complete: 'https://accounts.feishu.cn/oauth/device?code=1' })
const login = (missing: string[] = [], openId = 'ou_1') => JSON.stringify({ event: 'authorization_complete', user_open_id: openId, missing })
type Script = (process: ScriptedProcess) => void
let ctx: Context
let subprocess: ScriptedSubprocess
let binDir: string
/** The account the plugin registered, as the Plugins page registry drives it. */
let account: FeishuPage['source']
let script: Record<string, Script | CliReply[]>
beforeEach(async () => {
const host = await createHost()
;({ ctx, subprocess, binDir } = host)
await ctx.plugin(Feishu, { binDir })
account = host.pages[0]!.source
script = {}
subprocess.respond = (process) => {
const handler = script[process.spec.argv.slice(1).join(' ')]
if (handler === undefined) process.reply({ exitCode: 1, stderr: `unexpected: ${process.spec.argv.join(' ')}` })
else if (Array.isArray(handler)) process.reply(handler.length > 1 ? handler.shift()! : handler[0]!)
else handler(process)
}
})
afterEach(async () => {
await ctx.fiber.dispose()
await rm(binDir, { recursive: true, force: true })
})
/** Start an operation as a page button does; the CLI account Service starts it before returning. */
const start = (kind: FeishuOperationKind): ConnectorOperationId => {
const id = account.start(kind)
if (typeof id !== 'string') throw new Error('the operation did not start at once')
return id
}
const commands = () => subprocess.processes.map(process => process.spec.argv.slice(1).join(' '))
const errors = (): unknown[] => ctx.logger.buffer.filter(message => message.type === 'error').map((message): unknown => message.args)
describe('Feishu account operations', () => {
const settled = async (id: ConnectorOperationId): Promise<FeishuState> => {
await vi.waitFor(() => { expect(account.snapshot().result?.id).toBe(id) })
return account.snapshot()
}
it.each<[string, CliReply, FeishuState['account']]>([
['no app', NOT_CONFIGURED, { state: 'unconfigured' }],
['a verified user', CONNECTED, { state: 'connected', appId: APP, userName: '张三' }],
['a verified user without a name', status({ status: 'ready', available: true, verified: true }), { state: 'connected', appId: APP }],
['a missing user', SIGNED_OUT, { state: 'signed-out', appId: APP }],
['an expired user', status({ status: 'needs_refresh', available: true, verified: false }), { state: 'signed-out', appId: APP }],
['a failed verification', status({ status: 'verify_failed', available: true, verified: false }), { state: 'unverified', appId: APP }],
])('checks %s', async (_name, reply, expected) => {
script[STATUS] = [reply]
const id = start('check')
expect(account.snapshot().operation).toEqual({ id, kind: 'check', phase: 'checking', cancellable: false })
expect(await settled(id)).toEqual({ account: expected, result: { id, kind: 'check', outcome: 'succeeded' } })
})
it.each<[string, CliReply]>([
['an unexpected status failure', { exitCode: 1, stderr: '{"ok":false,"error":{"subtype":"network"}}' }],
['a status failure without JSON', { exitCode: 1, stderr: 'boom' }],
])('keeps the previous account and fails on %s', async (_name, reply) => {
script[STATUS] = [reply]
expect(await settled(start('check'))).toMatchObject({ account: { state: 'unchecked' }, result: { outcome: 'failed' } })
})
it('links an app through its setup page, offers only the first trusted link, and stops before sign-in', async () => {
script[STATUS] = [SIGNED_OUT]
const setup = Promise.withResolvers<ScriptedProcess>()
script['config init --new'] = (process) => { setup.resolve(process) }
const id = start('link-app')
const configuring = await setup.promise
expect(account.snapshot().operation).toEqual({ id, kind: 'link-app', phase: 'configuring', cancellable: true })
configuring.write('stderr', 'Open this link:\n http://open.feishu.cn/page/cli?x=1\n https://evil.example/page\n')
configuring.write('stderr', ' https://open.feishu.cn/page/cli?x=2\n https://open.feishu.cn/page/cli?x=3\n')
await vi.waitFor(() => { expect(account.snapshot().operation).toMatchObject({ phase: 'configuring', authorizationUrl: 'https://open.feishu.cn/page/cli?x=2' }) })
configuring.reply({})
expect(await settled(id)).toEqual({ account: { state: 'signed-out', appId: APP }, result: { id, kind: 'link-app', outcome: 'succeeded' } })
expect(commands()).toEqual(['config init --new', STATUS])
expect(errors()).toEqual([])
})
it('reports safe setup diagnostics to the page and Host without retrying or exposing native output', async () => {
script[STATUS] = [NOT_CONFIGURED]
await settled(start('check'))
const sensitive = 'secret-in-native-output'
script['config init --new'] = [{ exitCode: 5, stdout: sensitive, stderr: `QR\nhttps://open.feishu.cn/?user_code=${sensitive}\nApp created\n${JSON.stringify({
ok: false, error: { type: 'internal', subtype: 'sdk_error', message: sensitive, hint: sensitive },
}, null, 2)}\n` }]
const result = await settled(start('link-app'))
expect(result).toMatchObject({ account: { state: 'unconfigured' }, result: {
outcome: 'failed', failure: { command: 'config-init', exitCode: 5 },
} })
expect(errors()).toEqual([['feishu: account operation failed: %o', {
id: result.result?.id, kind: 'link-app', phase: 'configuring',
command: 'config-init', exitCode: 5,
}]])
expect(JSON.stringify({ result, errors: errors() })).not.toContain(sensitive)
expect(commands()).toEqual([STATUS, 'config init --new'])
})
it('attributes a post-setup check failure to auth status', async () => {
script['config init --new'] = [{}]
script[STATUS] = [{ exitCode: 5, stderr: '{"ok":false,"error":{"type":"internal","subtype":"storage"}}' }]
expect(await settled(start('link-app'))).toMatchObject({ result: {
outcome: 'failed', failure: { command: 'auth-status', exitCode: 5 },
} })
})
it('retains the observed exit code when the command response is invalid', async () => {
script[STATUS] = [{ stdout: 'invalid-json-secret' }]
const result = await settled(start('check'))
expect(result).toMatchObject({ result: { outcome: 'failed', failure: { command: 'auth-status', exitCode: 0 } } })
expect(JSON.stringify({ result, errors: errors() })).not.toContain('invalid-json-secret')
})
it('signs in through the authorization page and accepts a sign-in that leaves permissions ungranted', async () => {
script[STATUS] = [CONNECTED]
const signIn = Promise.withResolvers<ScriptedProcess>()
script['auth login --json'] = (process) => { signIn.resolve(process) }
const id = start('sign-in')
expect(account.snapshot().operation).toEqual({ id, kind: 'sign-in', phase: 'authorizing', cancellable: true })
const authorizing = await signIn.promise
const invalid = JSON.stringify({ event: 'device_authorization', verification_uri_complete: 'not a url' })
authorizing.write('stdout', `progress\n{"event":"other"}\n${invalid}\n${LOGIN_LINK}\n`)
await vi.waitFor(() => { expect(account.snapshot().operation).toMatchObject({ phase: 'authorizing', authorizationUrl: 'https://accounts.feishu.cn/oauth/device?code=1' }) })
authorizing.reply({ stdout: login(['im:message']) + '\n', exitCode: 3 })
expect(await settled(id)).toEqual({
account: { state: 'connected', appId: APP, userName: '张三' },
result: { id, kind: 'sign-in', outcome: 'succeeded' },
})
expect(commands()).toEqual(['auth login --json', STATUS])
})
it.each<[string, 'link-app' | 'sign-in', Record<string, CliReply[]>]>([
['a failed app setup', 'link-app', { 'config init --new': [{ exitCode: 1 }] }],
['an app setup that left no app', 'link-app', { [STATUS]: [NOT_CONFIGURED], 'config init --new': [{}] }],
['a sign-in without completion', 'sign-in', { 'auth login --json': [{ stdout: LOGIN_LINK + '\n' }] }],
['a failed sign-in', 'sign-in', { 'auth login --json': [{ stdout: login() + '\n', exitCode: 1 }] }],
['a partial sign-in that reports no missing permission', 'sign-in', { 'auth login --json': [{ stdout: login() + '\n', exitCode: 3 }] }],
['a different signed-in user', 'sign-in', { [STATUS]: [CONNECTED], 'auth login --json': [{ stdout: login([], 'ou_2') + '\n' }] }],
['an unverified sign-in', 'sign-in', { [STATUS]: [SIGNED_OUT], 'auth login --json': [{ stdout: login() + '\n' }] }],
])('fails on %s', async (_name, kind, replies) => {
Object.assign(script, replies)
expect((await settled(start(kind))).result).toMatchObject({ kind, outcome: 'failed' })
})
it('signs out without offering cancellation and reports a rejected sign-out', async () => {
script[STATUS] = [SIGNED_OUT]
script['auth logout --json'] = [{ stdout: '{"ok":true}' }, { exitCode: 1 }]
const id = start('sign-out')
expect(account.snapshot().operation).toEqual({ id, kind: 'sign-out', phase: 'signing-out', cancellable: false })
expect(await settled(id)).toEqual({ account: { state: 'signed-out', appId: APP }, result: { id, kind: 'sign-out', outcome: 'succeeded' } })
expect((await settled(start('sign-out'))).result).toMatchObject({
kind: 'sign-out', outcome: 'failed', failure: { command: 'auth-logout', exitCode: 1 },
})
})
})
describe('Feishu on the Plugins page', () => {
const finished = async (id: ConnectorOperationId): Promise<FeishuState['result']> => {
await vi.waitFor(() => { expect(account.snapshot().result?.id).toBe(id) })
return account.snapshot().result
}
it('checks on refresh, then starts checks, app links, sign-ins, and sign-outs one at a time and cancels them', async () => {
script[STATUS] = [SIGNED_OUT]
account.refresh()
const check = account.snapshot().operation
expect(account.snapshot()).toMatchObject({ account: { state: 'unchecked' }, operation: { kind: 'check' } })
expect(await finished(check!.id)).toMatchObject({ kind: 'check', outcome: 'succeeded' })
expect(account.snapshot().account).toEqual({ state: 'signed-out', appId: APP })
script['auth logout --json'] = [{ stdout: '{"ok":true}' }]
const signingOut = start('sign-out')
expect(() => start('sign-in')).toThrow('another account operation is in progress')
await account.cancel(signingOut)
expect(await finished(signingOut)).toMatchObject({ kind: 'sign-out', outcome: 'succeeded' })
expect(await finished(start('check'))).toMatchObject({ kind: 'check', outcome: 'succeeded' })
script['config init --new'] = () => {}
const linking = start('link-app')
await vi.waitFor(() => { expect(commands().at(-1)).toBe('config init --new') })
await account.cancel(linking)
expect(await finished(linking)).toMatchObject({ kind: 'link-app', outcome: 'cancelled' })
script['auth login --json'] = () => {}
const signingIn = start('sign-in')
await vi.waitFor(() => { expect(commands().at(-1)).toBe('auth login --json') })
await account.cancel(signingIn)
expect(await finished(signingIn)).toMatchObject({ kind: 'sign-in', outcome: 'cancelled' })
expect(subprocess.processes.at(-1)?.terminated).toBe(true)
})
it('stops account work on disposal', async () => {
script[STATUS] = () => {}
account.refresh()
await vi.waitFor(() => { expect(subprocess.processes).toHaveLength(1) })
await ctx.fiber.dispose()
expect(subprocess.processes[0]?.terminated).toBe(true)
})
})
@@ -0,0 +1,37 @@
import { constants } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { beforeEach, expect, it, vi } from 'vitest'
import { executableFileName, parseJson, resolveCliExecutable } from '../src/cli.ts'
const fs = vi.hoisted(() => ({ accessSync: vi.fn() }))
vi.mock('node:fs', async importOriginal => ({ ...await importOriginal<typeof import('node:fs')>(), accessSync: fs.accessSync }))
const PACKAGE_BIN = join(dirname(fileURLToPath(import.meta.resolve('@larksuite/cli/package.json'))), 'bin')
const FILE = process.platform === 'win32' ? 'lark-cli.exe' : 'lark-cli'
beforeEach(() => {
fs.accessSync.mockReset()
})
it('names the executable file with the .exe extension on Windows only', () => {
expect(executableFileName('win32')).toBe('lark-cli.exe')
expect(executableFileName('darwin')).toBe('lark-cli')
})
it('defaults to the executable in the installed @larksuite/cli bin directory', () => {
expect(resolveCliExecutable(undefined)).toBe(join(PACKAGE_BIN, FILE))
expect(fs.accessSync).toHaveBeenCalledWith(join(PACKAGE_BIN, FILE), constants.X_OK)
})
it('accepts a configured directory and names the missing executable with the install remedy', () => {
expect(resolveCliExecutable('/opt/lark/bin')).toBe(join('/opt/lark/bin', FILE))
fs.accessSync.mockImplementation(() => { throw new Error('EACCES') })
expect(() => resolveCliExecutable(PACKAGE_BIN))
.toThrow(`feishu: ${join(PACKAGE_BIN, FILE)} is not executable; approve the @larksuite/cli install script or set binDir`)
})
it('parses a command\'s JSON output and names the command whose output is not JSON', () => {
expect(parseJson(['auth', 'status'], '{"ok":false}')).toEqual({ ok: false })
expect(() => parseJson(['auth', 'status'], '')).toThrow('lark-cli auth status returned invalid JSON')
})
+152
View File
@@ -0,0 +1,152 @@
/** A Host for Feishu plugin specs: scripted lark-cli processes, a temporary bin directory, and a recording Plugins page registry. */
import { chmod, mkdtemp, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { PassThrough } from 'node:stream'
import { Context } from '@deepseek-ai/cordis'
import CliAccounts from '@deepseek-ai/dsh-cli-account'
import type { ConnectorAccountRegistration } from '@deepseek-ai/dsh-client-ui-connector-account/types'
import SkillRegistry from '@deepseek-ai/dsh-skill'
import { SubprocessRuntime } from '@deepseek-ai/dsh-subprocess'
import type {
SubprocessCollectedOutputs,
SubprocessHandle,
SubprocessOutcome,
SubprocessSpawnSpec,
SubprocessTerminalEnvironment,
} from '@deepseek-ai/dsh-subprocess'
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
import { executableFileName } from '../src/cli.ts'
import type { FeishuState } from '../src/types.ts'
/** Output and exit facts one scripted command reports. */
export interface CliReply {
stdout?: string
stderr?: string
exitCode?: number | null
signal?: NodeJS.Signals | null
}
/** A piped process whose managed range exits on termination. */
export class ScriptedProcess implements SubprocessHandle {
readonly stdin = undefined
readonly stdout = new PassThrough()
readonly stderr = new PassThrough()
readonly control = undefined
readonly collected: SubprocessCollectedOutputs = {}
readonly done: Promise<SubprocessOutcome>
terminated = false
private readonly outcome = Promise.withResolvers<SubprocessOutcome>()
private readonly exit = Promise.withResolvers<boolean>()
constructor(readonly spec: SubprocessSpawnSpec) {
this.done = this.outcome.promise
spec.signal?.addEventListener('abort', () => { this.terminate() }, { once: true })
}
/** Write output while the command keeps running. */
write(stream: 'stdout' | 'stderr', text: string): void {
this[stream].write(text)
}
/** Finish the command with the given output; the managed range stays alive until termination. */
reply(reply: CliReply): void {
if (reply.stdout !== undefined) this.stdout.write(reply.stdout)
if (reply.stderr !== undefined) this.stderr.write(reply.stderr)
this.close()
this.outcome.resolve({ exitCode: reply.exitCode === undefined ? 0 : reply.exitCode, signal: reply.signal ?? null })
}
terminate(): void {
this.terminated = true
this.close()
this.outcome.resolve({ exitCode: null, signal: 'SIGTERM' })
this.exit.resolve(true)
}
private close(): void {
if (!this.stdout.writableEnded) this.stdout.end()
if (!this.stderr.writableEnded) this.stderr.end()
}
waitForExit(): Promise<boolean> {
return this.exit.promise
}
}
/** Host subprocess runtime whose lookups and spawns are recorded and answered by `respond`. */
export class ScriptedSubprocess extends SubprocessRuntime {
readonly lookups: Array<{ command: string; env: Readonly<Record<string, string>> | undefined }> = []
readonly processes: ScriptedProcess[] = []
lookup: (signal?: AbortSignal) => Promise<string> = () => Promise.resolve('/fixture/bin/lark-cli')
respond: (process: ScriptedProcess) => void | Promise<void> = (process) => { process.reply({ stdout: '{}' }) }
override resolveExecutable(command: string, env?: Readonly<Record<string, string>>, signal?: AbortSignal): Promise<string> {
this.lookups.push({ command, env })
return this.lookup(signal)
}
override terminalEnvironment(): Promise<SubprocessTerminalEnvironment> {
return Promise.resolve({ platform: 'posix' })
}
override spawn(spec: SubprocessSpawnSpec): ScriptedProcess {
spec.signal?.throwIfAborted()
const process = new ScriptedProcess(spec)
this.processes.push(process)
queueMicrotask(() => { void this.respond(process) })
return process
}
override spawnTerminal(): Promise<never> {
throw new Error('lark-cli commands never allocate a terminal')
}
}
/**
* Create a temporary directory holding an executable `lark-cli` placeholder, `lark-cli.exe` on Windows.
* @returns the absolute bin directory.
*/
export async function createBinDir(): Promise<string> {
const directory = await mkdtemp(join(tmpdir(), 'dsh-feishu-bin-'))
await writeFile(join(directory, executableFileName(process.platform)), '')
await chmod(join(directory, executableFileName(process.platform)), 0o755)
return directory
}
/** What the Feishu plugin registers for the Plugins page. */
export type FeishuPage = ConnectorAccountRegistration<FeishuState>
/** The services the Feishu plugin runs on, before the plugin itself loads. */
export interface FeishuHost {
readonly ctx: Context
readonly subprocess: ScriptedSubprocess
/** The `binDir` to load the plugin with. */
readonly binDir: string
/** Every account registered for the Plugins page, in order; the registry keeps them after withdrawal. */
readonly pages: FeishuPage[]
/** How many of those accounts were withdrawn. */
withdrawn: number
}
/**
* Start a Host with the skill registry, a scripted subprocess runtime, the system prompt, a Plugins page registry that
* records registrations, and the CLI account Service with a 5-second command deadline.
* @returns the Host; the caller loads the Feishu plugin with `binDir`, disposes `ctx.fiber`, and removes `binDir`.
*/
export async function createHost(): Promise<FeishuHost> {
const ctx = new Context()
await ctx.plugin(SkillRegistry)
await ctx.plugin(ScriptedSubprocess)
await ctx.plugin(SystemPrompt)
const host: FeishuHost = { ctx, subprocess: ctx.subprocess as ScriptedSubprocess, binDir: await createBinDir(), pages: [], withdrawn: 0 }
ctx.provide('connectorAccounts', {
register: (page: FeishuPage) => {
host.pages.push(page)
return () => { host.withdrawn += 1 }
},
})
await ctx.plugin(CliAccounts, { commandTimeoutMs: 5_000 })
return host
}
@@ -0,0 +1,91 @@
import { readFile, rm } from 'node:fs/promises'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
import type { Context } from '@deepseek-ai/cordis'
import { renderContextSections } from '@deepseek-ai/dsh-system-prompt'
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import { cliPathContextText } from '@deepseek-ai/dsh-cli-account/src/context.ts'
import { executableFileName } from '../src/cli.ts'
import * as Feishu from '../src/index.ts'
import { FEISHU_PACKAGE } from '../src/presentation.ts'
import { createHost, type FeishuHost, type ScriptedSubprocess } from './harness.ts'
const ENTRY = fileURLToPath(new URL('../skills/feishu/SKILL.md', import.meta.url))
describe('Config', () => {
it('takes the CLI directory, which is optional and never empty', () => {
expect(Feishu.Config({})).toEqual({})
expect(Feishu.Config({ binDir: '/opt/lark/bin' })).toEqual({ binDir: '/opt/lark/bin' })
expect(() => Feishu.Config({ binDir: '' })).toThrow()
})
})
describe('Feishu plugin', () => {
let host: FeishuHost
let ctx: Context
let subprocess: ScriptedSubprocess
let binDir: string
let warnings: string[]
beforeEach(async () => {
host = await createHost()
;({ ctx, subprocess, binDir } = host)
warnings = []
ctx.logger.warn = ((message: unknown) => { warnings.push(String(message)) }) as typeof ctx.logger.warn
})
afterEach(async () => {
await ctx.fiber.dispose()
await rm(binDir, { recursive: true, force: true })
})
const runtimeContext = async () => renderContextSections(await ctx.systemPrompt.assemble())
it('lists the packaged feishu skill and loads its entry without running lark-cli', async () => {
await ctx.plugin(Feishu, { binDir })
expect(await ctx.skills.list()).toEqual([{
name: 'feishu',
description: expect.stringContaining('Load it before any Feishu or Lark task') as string,
invocation: { modelInvocable: true, userInvocable: true },
provider: 'feishu',
source: 'bundled',
resourceBase: { kind: 'opaque', description: 'Embedded lark-cli guides; open them with the skills read command given in the loaded skill.' },
}])
const loaded = await ctx.skills.get('feishu')
const file = await readFile(ENTRY, 'utf8')
expect(loaded?.content.trim()).toBe(file.slice(file.indexOf('\n---\n', 4) + '\n---\n'.length).trim())
expect(loaded?.content).toContain('# Feishu in DSH')
expect(loaded?.content).toContain('open one with `lark-cli skills read <name>` in the Host Shell, not with the skill tool')
expect(subprocess.lookups).toEqual([])
expect(subprocess.processes).toEqual([])
expect(warnings).toEqual([])
})
it('withdraws the runtime context and the skill on disposal', async () => {
const fiber = await ctx.plugin(Feishu, { binDir })
expect(await runtimeContext()).toEqual([{
name: 'feishu:cli',
text: cliPathContextText({ product: 'Feishu', program: 'lark-cli', executable: join(binDir, executableFileName(process.platform)) }, process.platform),
}])
expect((await ctx.skills.list()).map(skill => skill.name)).toEqual(['feishu'])
await fiber.dispose()
expect(await runtimeContext()).toEqual([])
expect(await ctx.skills.list()).toEqual([])
expect(warnings).toEqual([])
})
it('shows the account on the Plugins page while the registry runs, and withdraws it with the plugin', async () => {
const fiber = await ctx.plugin(Feishu, { binDir })
expect(host.pages).toHaveLength(1)
expect(host.pages[0]).toMatchObject({ key: FEISHU_PACKAGE, packageName: FEISHU_PACKAGE })
expect(host.pages[0]!.source.snapshot().account.state).toBe('unchecked')
await fiber.dispose()
expect(host.withdrawn).toBe(1)
})
})
@@ -0,0 +1,149 @@
/** The Feishu section offers each state's next step, the linked app, confirmations, and failure guidance, in every shipped language. */
import type { LocalizedText } from '@deepseek-ai/dsh-package-manifest'
import type { ConnectorAccountDisplay, ConnectorOperationId } from '@deepseek-ai/dsh-client-ui-connector-account/types'
import { rm } from 'node:fs/promises'
import { afterAll, beforeAll, expect, it } from 'vitest'
import * as Feishu from '../src/index.ts'
import { en, zh, type FeishuTextKey } from '../src/locales.ts'
import type { FeishuAppId, FeishuState } from '../src/types.ts'
import { createHost, type FeishuHost, type FeishuPage } from './harness.ts'
const OP = 'op' as ConnectorOperationId
const APP = 'cli_a' as FeishuAppId
const LINK = 'https://x.feishu.cn'
const CHECK = { kind: 'start', operation: 'check' } as const
const LINK_APP = { kind: 'start', operation: 'link-app' } as const
const SIGN_IN = { kind: 'start', operation: 'sign-in' } as const
const SIGN_OUT = { kind: 'start', operation: 'sign-out' } as const
/** The key's text as the Chinese and English browsers resolve it. */
const say = (key: FeishuTextKey): Partial<Record<string, string>> => ({ zh: zh[key], en: en[key] })
const zhOf = (text: LocalizedText | undefined): string | undefined => typeof text === 'object' ? text.zh : text
const labels = (display: ConnectorAccountDisplay): (string | undefined)[] => display.buttons.map(button => zhOf(button.label))
let host: FeishuHost
/** What the plugin registered for the Plugins page, with the failure details the CLI account Service adds. */
let page: FeishuPage
beforeAll(async () => {
host = await createHost()
await host.ctx.plugin(Feishu, { binDir: host.binDir })
page = host.pages[0]!
})
afterAll(async () => {
await host.ctx.fiber.dispose()
await rm(host.binDir, { recursive: true, force: true })
})
const presentAccount = (view: FeishuState): ConnectorAccountDisplay => page.present(view)
const UNCONFIGURED: FeishuState = { account: { state: 'unconfigured' } }
const SIGNED_OUT: FeishuState = { account: { state: 'signed-out', appId: APP } }
it('links an app first, then signs in, with each step\'s page, guidance, and cancel', () => {
let shown = presentAccount(UNCONFIGURED)
expect(shown).toMatchObject({
phase: 'disconnected', status: say('status.disconnected'), badge: say('badge.disconnected'),
detail: say('detail.no-app'), connect: LINK_APP, notes: [],
})
expect(shown.buttons).toMatchObject([{ label: say('action.linkApp'), command: LINK_APP, variant: 'primary' }])
shown = presentAccount({ ...UNCONFIGURED, operation: { id: OP, kind: 'link-app', phase: 'configuring', cancellable: true } })
expect(shown).toMatchObject({ phase: 'connecting', status: say('step.configuring'), badge: say('badge.connecting') })
expect(labels(shown)).toEqual([zh['action.cancel']])
expect(shown.detail).toBeUndefined()
shown = presentAccount({ ...UNCONFIGURED, operation: { id: OP, kind: 'link-app', phase: 'configuring', cancellable: true, authorizationUrl: LINK } })
expect(shown.detail).toMatchObject(say('detail.configuring'))
shown = presentAccount(SIGNED_OUT)
expect(shown).toMatchObject({ phase: 'disconnected', detail: say('detail.signed-out'), connect: SIGN_IN })
expect(shown.buttons).toMatchObject([{ label: say('action.signIn'), command: SIGN_IN, variant: 'primary' }])
shown = presentAccount({ ...SIGNED_OUT, operation: { id: OP, kind: 'sign-in', phase: 'authorizing', cancellable: true, authorizationUrl: LINK } })
expect(shown).toMatchObject({ status: say('step.authorizing'), detail: say('detail.authorizing') })
expect(shown.buttons.map(button => button.command)).toEqual([{ kind: 'open' }, { kind: 'cancel' }])
for (const [phase, status] of [['verifying', 'step.connecting'], ['checking', 'step.connecting'], ['cancelling', 'step.connecting']] as const) {
shown = presentAccount({ ...SIGNED_OUT, operation: { id: OP, kind: 'sign-in', phase, cancellable: false } })
expect(shown).toMatchObject({ status: say(status), buttons: [] })
}
shown = presentAccount({ ...SIGNED_OUT, operation: { id: OP, kind: 'sign-out', phase: 'signing-out', cancellable: false, authorizationUrl: LINK } })
expect(shown).toMatchObject({ status: say('step.signing-out') })
expect(shown.detail).toBeUndefined()
expect(labels(shown)).toEqual([zh['action.open']])
shown = presentAccount({ ...SIGNED_OUT, operation: { id: OP, kind: 'link-app', phase: 'signing-out', cancellable: false } })
expect(shown).toMatchObject({ status: say('step.signing-out') })
for (const view of [
{ ...SIGNED_OUT, operation: { id: OP, kind: 'check', phase: 'checking', cancellable: false } },
{ account: { state: 'unchecked' } },
] as const satisfies readonly FeishuState[]) {
shown = presentAccount(view)
expect(shown).toMatchObject({ phase: 'checking', status: say('status.checking'), buttons: [], notes: [] })
expect(shown.badge).toBeUndefined()
}
})
it('retries an unconfirmed sign-in by checking again', () => {
const shown = presentAccount({ account: { state: 'unverified', appId: APP } })
expect(shown).toMatchObject({ phase: 'unavailable', status: say('status.unavailable'), badge: say('badge.unavailable'), detail: say('detail.unavailable') })
expect(shown.buttons).toMatchObject([{ label: say('action.retry'), command: CHECK }])
})
it('reports app-link recovery with the command and exit code', () => {
let shown = presentAccount({
...UNCONFIGURED,
result: { id: OP, kind: 'link-app', outcome: 'failed', failure: { command: 'config-init', exitCode: 1 } },
})
expect(labels(shown)).toEqual([zh['action.linkApp']])
expect(shown.failure).toMatchObject({ text: say('failed.linkApp'), details: ['config-init', 'exit 1'] })
shown = presentAccount({ ...SIGNED_OUT, result: { id: OP, kind: 'link-app', outcome: 'failed', failure: { command: 'auth-status', exitCode: null } } })
expect(labels(shown)).toEqual([zh['action.signIn']])
expect(shown.failure).toMatchObject({ text: say('failed.linkApp'), details: ['auth-status'] })
expect(presentAccount({ ...UNCONFIGURED, result: { id: OP, kind: 'link-app', outcome: 'cancelled' } }).failure).toBeUndefined()
})
it.each(['sign-in', 'sign-out', 'check'] as const)('keeps the generic guidance for a failed %s', (kind) => {
const failure = presentAccount({ ...SIGNED_OUT, result: { id: OP, kind, outcome: 'failed' } }).failure
expect(failure).toMatchObject({ text: say('failed') })
expect(failure).not.toHaveProperty('details')
})
it('shows who is signed in and asks before signing out', () => {
expect(zhOf(presentAccount({ account: { state: 'connected', appId: APP, userName: '张三' } }).detail)).toBe(zh['detail.connectedAs'].replace('{name}', '张三'))
const shown = presentAccount({ account: { state: 'connected', appId: APP } })
expect(shown).toMatchObject({ phase: 'connected', status: say('status.connected'), badge: say('badge.connected'), detail: say('detail.connected') })
expect(shown.buttons).toMatchObject([{
label: say('action.signOut'), command: SIGN_OUT,
confirm: { title: say('signOut.title'), body: say('signOut.body'), label: say('action.signOut') },
}])
})
it('shows the linked app and asks before changing it', () => {
for (const view of [SIGNED_OUT, { account: { state: 'unverified', appId: APP } }, { account: { state: 'connected', appId: APP } }] as const satisfies readonly FeishuState[]) {
const [note] = presentAccount(view).notes
expect(zhOf(note?.text)).toBe(zh['app.linked'].replace('{id}', 'cli_a'))
expect(note?.button).toMatchObject({
label: say('action.replaceApp'), command: LINK_APP, variant: 'ghost',
confirm: { title: say('replaceApp.title'), body: say('replaceApp.body'), label: say('action.replaceApp') },
})
}
})
it('names the section, its activation prompt, and the notice of each page operation', () => {
expect(page.copy).toMatchObject({
title: say('section.title'), hint: say('hint'),
activation: { title: say('activation.title'), body: say('activation.body'), connect: say('action.connect') },
})
expect(page.operations).toMatchObject([
{ kind: 'check' },
{ kind: 'link-app', notice: say('notice.app-linked') },
{ kind: 'sign-in', notice: say('notice.connected') },
{ kind: 'sign-out', notice: say('notice.signed-out') },
])
expect(page.operations[0]).not.toHaveProperty('notice')
})
@@ -0,0 +1,70 @@
/** The packaged entry skill: its index names exactly the guides lark-cli 1.0.97 embeds, and it stays below the pruner threshold. */
import { readdirSync, readFileSync } from 'node:fs'
import { mkdtemp, rm, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { renderSkillContent } from '@deepseek-ai/dsh-skill'
import { expect, it } from 'vitest'
import { FeishuSkillProvider } from '../src/skills.ts'
const skills = fileURLToPath(new URL('../skills/', import.meta.url))
const entry = join(skills, 'feishu')
/** The guides `lark-cli skills list` reports in the pinned `@larksuite/cli` 1.0.97. */
const GUIDES = [
'lark-approval', 'lark-apps', 'lark-attendance', 'lark-base', 'lark-calendar', 'lark-contact', 'lark-doc', 'lark-drive',
'lark-event', 'lark-im', 'lark-mail', 'lark-markdown', 'lark-meeting', 'lark-minutes', 'lark-note', 'lark-okr',
'lark-openapi-explorer', 'lark-shared', 'lark-sheets', 'lark-skill-maker', 'lark-slides', 'lark-task', 'lark-vc',
'lark-vc-agent', 'lark-whiteboard', 'lark-wiki', 'lark-workflow-meeting-summary', 'lark-workflow-standup-report',
]
/**
* `packages/bundle/web-app/presets/standard.patch.yml` prunes a tool result only above `thresholdChars: 8192`
* code points; a skill result below it reaches the model intact.
*/
const PRUNER_THRESHOLD_CHARS = 8192
/** The body the `skill` tool returns: the file without its YAML frontmatter. */
function body(): string {
const text = readFileSync(join(entry, 'SKILL.md'), 'utf8')
const end = text.indexOf('\n---\n', 4)
return text.slice(end + '\n---\n'.length)
}
it('ships only the feishu entry; its guides stay in lark-cli', () => {
expect(readdirSync(skills, { recursive: true }).toSorted()).toEqual(['feishu', join('feishu', 'SKILL.md')])
})
it('renders the entry below the pruner threshold', () => {
const rendered = renderSkillContent({ name: 'feishu', provider: 'feishu', resourceBase: { kind: 'directory', path: entry }, content: body() })
expect(Array.from(rendered).length).toBeLessThan(PRUNER_THRESHOLD_CHARS)
})
it('indexes every guide of the pinned lark-cli exactly once', () => {
const indexed = [...body().matchAll(/^- `([a-z-]+)`:/gmu)].map(match => match[1] ?? '')
expect(indexed.toSorted()).toEqual(GUIDES)
})
it('lists the entry with an opaque resource base and returns its body without the catalog-only fields', async () => {
const file = join(entry, 'SKILL.md')
const provider = new FeishuSkillProvider(file)
expect(await provider.list()).toMatchObject([{ name: 'feishu', provider: 'feishu', source: 'bundled', locator: file, resourceBase: { kind: 'opaque' } }])
const definition = await provider.get()
expect(definition).not.toHaveProperty('rank')
expect(definition).not.toHaveProperty('locator')
expect(definition.content).toBe(body().trim())
})
it('refuses an entry without YAML frontmatter or without a skill name and description', async () => {
const dir = await mkdtemp(join(tmpdir(), 'dsh-feishu-entry-'))
try {
const file = join(dir, 'SKILL.md')
await writeFile(file, '# No frontmatter\n')
expect(() => new FeishuSkillProvider(file)).toThrow('has no YAML frontmatter')
await writeFile(file, '---\nname: Not A Skill\n---\n\nbody\n')
expect(() => new FeishuSkillProvider(file)).toThrow('needs a skill name and a description')
} finally {
await rm(dir, { recursive: true, force: true })
}
})
+33
View File
@@ -0,0 +1,33 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib/types"
},
"include": [
"src"
],
"references": [
{
"path": "../../../vendor/cordis"
},
{
"path": "../../../vendor/schemastery"
},
{
"path": "../../util/brand"
},
{
"path": "../../util/values"
},
{
"path": "../../skill/skill"
},
{
"path": "../cli-account"
},
{
"path": "../../client/ui-connector-account/tsconfig.host.json"
}
]
}
@@ -24,8 +24,8 @@
en: e6ac1f330c18c69c
zh: 9e969a5b377ba62a
/deepseek-ai-dsh-time-context/use-this-package/choosing-the-zone:
en: 7eed0d784ad7381b
zh: 47a849df0ce80105
en: 80a0f2b83654aa47
zh: a0708ed67a47966a
/deepseek-ai-dsh-time-context/understand-the-implementation:
en: 2d21fa2aad5a729d
zh: cfbfada0eb647435
@@ -33,8 +33,8 @@
en: 48381ad4596a177a
zh: be025dba74956fc8
/deepseek-ai-dsh-time-context/understand-the-implementation/source-map:
en: 269d7aa1f64c4278
zh: 086018a60cc3a351
en: bda31c286dfd6ea5
zh: c2f6e79a73a10e28
/deepseek-ai-dsh-time-context/understand-the-implementation/main-flow:
en: 9ec32c75627991bb
zh: 7ee417dda0aa90a4
+2 -2
View File
@@ -50,7 +50,7 @@ The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-a
### Choosing the zone
When the open turn contains exactly one Host-validated browser zone, the timestamp is formatted in that request-local zone. With missing or mixed browser-zone records, the configured `timeZone` formats the display; omitting it resolves the Node process zone once at plugin load, and every explicit fallback is validated through `Intl.DateTimeFormat`. The resolved instruction tells the model to interpret unqualified dates and times in the chosen zone, and to ask the user to clarify when those records are mixed or unavailable.
A request-local zone is the canonical `clientTimeZone` that a writer records on a user message: the Web Host records the validated browser zone, and the SDK runtime records the prompt's explicit zone or its sampled process zone. Request preparation still refuses a noncanonical value. When the open turn contains exactly one such zone, the timestamp is formatted in that request-local zone. With missing or mixed browser-zone records, the configured `timeZone` formats the display; omitting it resolves the Node process zone once at plugin load, and every explicit fallback is validated through `Intl.DateTimeFormat`. The resolved instruction tells the model to interpret unqualified dates and times in the chosen zone, and to ask the user to clarify when those records are mixed or unavailable.
-----
@@ -71,7 +71,7 @@ The plugin prepends an `agent/pre-step` listener that delegates first and append
| File | Role |
|---|---|
| [`src/index.ts`](src/index.ts) | Plugin entry: pre-step listener, due scheduling, reading composition |
| [`src/request-zone.ts`](src/request-zone.ts) | Browser-zone policy derivation from open-turn `user-rpc` sources |
| [`src/request-zone.ts`](src/request-zone.ts) | Browser-zone policy derivation from open-turn user sources that carry `clientTimeZone` |
| [`src/timestamp.ts`](src/timestamp.ts) | `Intl.DateTimeFormat` creation and timestamp formatting |
### Main flow
+2 -2
View File
@@ -50,7 +50,7 @@ kind: "package-reference"
### 选择时区
当当前开放轮次只包含一个经 Host 校验的浏览器时区时,时间戳按该请求本地时区格式化。浏览器来源信息缺失或混杂时,配置的 `timeZone` 格式化显示;省略它则在插件加载时解析一次 Node 进程时区,每个显式回退值都经 `Intl.DateTimeFormat` 校验。解析后的指令告诉模型按所选时区解释未限定的日期与时间;来源信息混杂或不可用时,则要求用户澄清。
请求本地时区是写入方记录在用户消息上的规范化 `clientTimeZone`:Web Host 记录经校验的浏览器时区,SDK 运行时记录该 prompt 显式传入的时区或采样到的进程时区。请求准备阶段仍拒绝非规范值。当当前开放轮次只包含一个这样的时区时,时间戳按该请求本地时区格式化。浏览器来源信息缺失或混杂时,配置的 `timeZone` 格式化显示;省略它则在插件加载时解析一次 Node 进程时区,每个显式回退值都经 `Intl.DateTimeFormat` 校验。解析后的指令告诉模型按所选时区解释未限定的日期与时间;来源信息混杂或不可用时,则要求用户澄清。
-----
@@ -71,7 +71,7 @@ kind: "package-reference"
| 文件 | 职责 |
|---|---|
| [`src/index.ts`](src/index.ts) | 插件入口:pre-step 监听器、到期调度、读数组合 |
| [`src/request-zone.ts`](src/request-zone.ts) | 从开放轮次 `user-rpc` 来源派生浏览器时区策略 |
| [`src/request-zone.ts`](src/request-zone.ts) | 从开放轮次中带 `clientTimeZone` 的用户来源派生浏览器时区策略 |
| [`src/timestamp.ts`](src/timestamp.ts) | `Intl.DateTimeFormat` 创建与时间戳格式化 |
### 主要流程
@@ -1,4 +1,4 @@
/** Browser-zone facts from committed or proposed user-rpc messages and model-facing policy text. */
/** Browser-zone facts from committed or proposed user messages and model-facing policy text. */
import { canonicalizeTimeZone } from '@deepseek-ai/dsh-util-time'
import type { UserMessage } from '@deepseek-ai/dsh-llm'
@@ -11,15 +11,14 @@ export type BrowserTimeZoneContext =
| { readonly kind: 'missing' }
/**
* Read the raw zone reported by a user-rpc source; validation belongs to request preparation.
* @param message - user message; only user sources with a string rpcId and clientTimeZone contribute.
* @returns the reported zone, or undefined when no user-rpc zone was reported.
* Read the raw zone reported by a user source; validation belongs to request preparation.
* Writers canonicalize the zone before commit, and request preparation still refuses a noncanonical value.
* @param message - user message; only user sources with a string clientTimeZone contribute.
* @returns the reported zone, or undefined when no user zone was reported.
*/
export function reportedBrowserTimeZone(message: UserMessage): string | undefined {
const source = message.source
return source.kind === 'user'
&& 'rpcId' in source
&& typeof source.rpcId === 'string'
&& 'clientTimeZone' in source
&& typeof source.clientTimeZone === 'string'
? source.clientTimeZone
@@ -56,7 +55,7 @@ function browserTimeZone(value: string): string {
* @param messages - proposed messages, or entered plus proposed messages selected by the legacy reader.
* @param enteredTimeZones - reported zones from committed messages, before the proposed messages.
* @returns Sorted, duplicate-free browser-zone facts.
* @throws TypeError when a user-rpc source carries an invalid or noncanonical zone.
* @throws TypeError when a user source carries an invalid or noncanonical zone.
*/
export function deriveBrowserTimeZoneContext(
messages: readonly UserMessage[],
@@ -5,6 +5,7 @@ import type { ContextFormed } from '@deepseek-ai/dsh-llm'
import {
deriveBrowserTimeZoneContext,
renderBrowserTimeZoneContext,
reportedBrowserTimeZone,
} from '../src/request-zone.ts'
declare module '@deepseek-ai/dsh-llm' {
@@ -21,7 +22,7 @@ function browserMessage(timeZone: string): UserMessage {
}
describe('browser request-zone context', () => {
it('derives missing, unique, and sorted mixed zones from user-rpc messages only', () => {
it('derives missing, unique, and sorted mixed zones from user messages only', () => {
const plugin = createUserMessage({
content: [{ type: 'text', text: 'plugin' }],
source: { kind: 'test' },
@@ -40,6 +41,22 @@ describe('browser request-zone context', () => {
})
})
it('reads a string clientTimeZone from any user source, with or without an rpcId', () => {
const user = (source: object): UserMessage => createUserMessage({
content: [{ type: 'text', text: 'zone' }],
source: source as never,
})
expect(reportedBrowserTimeZone(user({ kind: 'user', rpcId: 'rpc', clientTimeZone: 'Asia/Shanghai' }))).toBe('Asia/Shanghai')
expect(reportedBrowserTimeZone(user({ kind: 'user', clientTimeZone: 'Europe/London' }))).toBe('Europe/London')
expect(reportedBrowserTimeZone(user({ kind: 'user', rpcId: 'rpc' }))).toBeUndefined()
expect(reportedBrowserTimeZone(user({ kind: 'user' }))).toBeUndefined()
expect(reportedBrowserTimeZone(user({ kind: 'retry', rpcId: 'rpc', clientTimeZone: 'Asia/Shanghai' }))).toBeUndefined()
expect(deriveBrowserTimeZoneContext([
user({ kind: 'user', clientTimeZone: 'Europe/London' }),
browserMessage('Europe/London'),
])).toEqual({ kind: 'resolved', timeZone: 'Europe/London' })
})
it('validates every browser zone before classifying a mixed turn', () => {
expect(() => deriveBrowserTimeZoneContext([
browserMessage('+08:00'),
@@ -196,6 +196,23 @@ describe('durable step context', () => {
expect(event.surfaceOp).toBe('append')
})
it('reads a zone from a user source without an rpcId through the committed-turn projection', async () => {
const { ctx } = await mount()
const session = Session.create(brandString<SessionId>('rpc-free-zone'))
session.append('turn/start', { turn: 1 })
session.append('user/message', createUserMessage({
content: [{ type: 'text', text: 'turn 1' }],
source: { kind: 'user', clientTimeZone: 'Asia/Shanghai' } as never,
}), { surfaceOp: 'append' })
await fire(ctx, sessionAgent(session), 1, 1)
expect(contextTexts(session)[0]).toContain(
'+08:00[Asia/Shanghai]\n'
+ 'Browser time zone for this request: Asia/Shanghai. Interpret otherwise-unqualified dates and times in this zone.\n',
)
})
it('reports an unavailable first-step baseline when no model-visible message precedes it', async () => {
const { ctx } = await mount()
const session = Session.create(brandString<SessionId>('unavailable'))
@@ -9,17 +9,17 @@
en: 0fbe7569a8801a86
zh: 794c1773e8825da5
/deepseek-ai-dsh-experimental-worktree/summary:
en: 954278bb62827f55
zh: cb96870bfb05ec23
en: 2a42bb18e98089c3
zh: ca21002331357f8f
/deepseek-ai-dsh-experimental-worktree/table-of-contents:
en: d152484eb41ac6b4
zh: 2f8a621b991260a1
/deepseek-ai-dsh-experimental-worktree/use-this-package:
en: a7f92c99db8e447d
zh: b584674be711d238
en: 70c160e999325034
zh: 890bc63cec1cc21e
/deepseek-ai-dsh-experimental-worktree/understand-the-implementation:
en: 6971a7ca9073bef1
zh: b977c28a75c7f963
en: d4221efd1784c681
zh: eb713be9f8e1825c
/deepseek-ai-dsh-experimental-worktree/further-exploration:
en: 5bcd45f0bba56207
zh: fd6342fd6bac5179
+3 -3
View File
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
## Summary
Create an isolated checkout from a local commit and continue the same Session in it. Each operation creates a new named branch and leaves the source checkout intact. The existing sandbox governs all writes. Leaving the checkout retains its files and branch.
Create an isolated checkout from a local commit and continue the same Session in it. Each operation creates a new named branch and leaves the source checkout intact. The existing sandbox governs all writes except archive cleanup. Leaving the checkout retains its files and branch.
## Table of Contents
@@ -40,7 +40,7 @@ Mount the service alongside `workingDirectory`, `fs`, `subprocess`, `sandbox`, `
`ctx.worktrees.restore(agent, { path, branch, baseCommit, repositoryRoot }, signal?, onPhase?)` checks a removed worktree out again at its recorded directory. It validates the recorded repository root, full commit object name, branch, and canonical target inside the configured pool before mutation. It removes only the missing target's unlocked registration with `git worktree remove`; other worktrees and locked registrations remain unchanged. Its commands run under the Session's policy bounded by the recorded source checkout, which contains the target, so a Session whose own root is the removed worktree can restore it. It then checks out the branch when it still exists, or creates the branch again at `baseCommit` when it does not, and reports which happened as `branchRecreated`. An existing directory is an error. The calling Session's working directory does not change, and changes that were never committed are not recovered. Checkout disables filters as creation does. `onPhase` receives `prepare` before validation, target-registration cleanup, and branch creation, and `checkout` before the files are written; it must not throw.
Every creation appends a `plugin:worktree/created` record to the Session log after the directory change, so the `worktree` projection lists the Session's checkouts with `owned` false for one inside a fork-inherited prefix. Every entry appends a `plugin:worktree/entered` record, which only `exit` reads: archiving a Session never removes a checkout it only entered, and an entry does not retain a checkout the Session has left. When the Workspace archives a Session, the service registers one `scheduled` cleanup for the first checkout that Session created itself and returns; the inspection runs in the background. While `retainOnArchive` is on, archiving registers nothing and every checkout stays; the field is volatile and read at each archive, and the [Forge panel](../client-ui-forge/README.md) edits it as a switch on the bundle's worktree row of the Plugins page. The checkout is retained while any unarchived Session refers to it, by a recorded creation or by a working directory inside it (a Session beneath an archived subagent ancestor counts as archived; cold Sessions are read from the projection cache or their log), and while the creator's sandbox policy is read-only. An eligible checkout is removed with a non-force `git worktree remove` under the creator's policy bounded by the recorded source checkout, which contains the target, after a second use check inside the path lock, which also holds `ensure` and `set` into that path through `working-directory/access`; the branch and its commits remain. Tracked changes, untracked files, an initialized submodule (a repository in the checkout's administrative `modules` directory), locks, detached HEAD, a mismatched branch, and targets outside the configured pool retain the checkout. Ignored files and edits to skip-worktree or assume-unchanged files do not: `git status` reports neither, and Git discards them with the checkout. A committed embedded repository is not inspected; Git refuses that removal, so the attempt settles as `failed`. Inspection stops reading `git status` at its first entry and streams the worktree listing, keeping its entries in memory while it looks for the checkout; neither output is bounded by `maxOutputBytes`. Processes are not consulted: a process still writing there makes Git refuse, and an idle one fails its next command. Unarchiving cancels an unadmitted removal and waits for an admitted one. `cleanupOf(session, revision)` reads the attempt, or waits for a named revision to settle, as `scheduled`, `retained`, `removed`, or `failed`; a failure leaves the Session archived and logs a warning. Checkouts created before this event existed, and Sessions archived earlier, are not swept.
Every creation appends a `plugin:worktree/created` record to the Session log after the directory change, so the `worktree` projection lists the Session's checkouts with `owned` false for one inside a fork-inherited prefix. Every entry appends a `plugin:worktree/entered` record, which only `exit` reads: archiving a Session never removes a checkout it only entered, and an entry does not retain a checkout the Session has left. When the Workspace archives a Session, the service registers one `scheduled` cleanup for the first checkout that Session created itself and returns; the inspection runs in the background. While `retainOnArchive` is on, archiving registers nothing and every checkout stays; the field is volatile and read at each archive, and the [Forge panel](../client-ui-forge/README.md) edits it as a switch on the bundle's worktree row of the Plugins page. The checkout is retained while any unarchived Session refers to it, by a recorded creation or by a working directory inside it (a Session beneath an archived subagent ancestor counts as archived; cold Sessions are read from the projection cache or their log). A cold creator is observed through `sessionQuery.observeSession` without being attached or resumed. Archiving is the user's authorization to remove the checkout, so cleanup reads no sandbox policy and its Git commands run unconfined; only the checks below bound it. An eligible checkout is removed with a non-force `git worktree remove`, run from the recorded source checkout, which contains the target, after a second use check inside the path lock, which also holds `ensure` and `set` into that path through `working-directory/access`; the branch and its commits remain. Tracked changes, untracked files, an initialized submodule (a repository in the checkout's administrative `modules` directory), locks, detached HEAD, a mismatched branch, and targets outside the configured pool retain the checkout. Ignored files and edits to skip-worktree or assume-unchanged files do not: `git status` reports neither, and Git discards them with the checkout. A committed embedded repository is not inspected; Git refuses that removal, so the attempt settles as `failed`. Inspection stops reading `git status` at its first entry and streams the worktree listing, keeping its entries in memory while it looks for the checkout; neither output is bounded by `maxOutputBytes`. Processes are not consulted: a process still writing there makes Git refuse, and an idle one fails its next command. Unarchiving cancels an unadmitted removal and waits for an admitted one. `cleanupOf(session, revision)` reads the attempt, or waits for a named revision to settle, as `scheduled`, `retained`, `removed`, or `failed`; a failure leaves the Session archived and logs a warning. Checkouts created before this event existed, and Sessions archived earlier, are not swept.
Expected failures throw `WorktreeError` with a stable `code`: `WORKTREE_INVALID_ARGUMENT` for a name Git or the pool rules reject, an empty start revision, or a restoration record that violates a documented constraint, while a start revision or base commit Git cannot resolve fails as `WORKTREE_COMMAND_FAILED`; `WORKTREE_ALREADY_EXISTS` for an existing branch or path; `WORKTREE_LOCKED` for a locked registration; `WORKTREE_NOT_FOUND` for an entry whose name selects no registered worktree in the pool; `WORKTREE_NOT_ENTERED` for an exit while the Session's directory lies in no recorded worktree; `WORKTREE_COMMAND_FAILED`, `WORKTREE_OUTPUT_TOO_LARGE`, and `WORKTREE_TIMEOUT` for a command that exits unsuccessfully, exceeds `maxOutputBytes`, or exceeds `timeoutMs`; and `WORKTREE_UNAVAILABLE` after service disposal. A failure after directory allocation adds the retained-artifact context to its message and keeps the original error's `name` and `code`; caller cancellation stays an `AbortError`.
@@ -54,7 +54,7 @@ The default checkout directory is `<current checkout root>/.agents/worktrees/<na
<details>
<summary>Implementation internals — click to expand</summary>
Git and directory allocation run through the mounted subprocess and sandbox providers with the calling Session's existing file policy. Creation does not widen write access to the destination or shared Git administration directory. Directory creation claims the destination exclusively; cancellation and failed setup can leave retained artifacts, whose path appears in the error. Service disposal aborts pending operations and waits for their settlement.
Git and directory allocation run through the mounted subprocess and sandbox providers with the calling Session's existing file policy; archive cleanup runs them unconfined. Creation does not widen write access to the destination or shared Git administration directory. Directory creation claims the destination exclusively; cancellation and failed setup can leave retained artifacts, whose path appears in the error. Service disposal aborts pending operations and waits for their settlement.
| Source | Responsibility |
|---|---|
+3 -3
View File
@@ -9,7 +9,7 @@ kind: "package-reference"
## 概述
从本地提交创建隔离的检出目录,并在其中继续同一个 Session。每次操作创建新的具名分支,源检出目录保持不变。所有写入均受现有沙箱约束。离开检出目录会保留文件与分支。
从本地提交创建隔离的检出目录,并在其中继续同一个 Session。每次操作创建新的具名分支,源检出目录保持不变。除归档清理外,所有写入均受现有沙箱约束。离开检出目录会保留文件与分支。
## 目录
@@ -40,7 +40,7 @@ kind: "package-reference"
`ctx.worktrees.restore(agent, { path, branch, baseCommit, repositoryRoot }, signal?, onPhase?)` 在记录的目录重新检出被删除的 worktree。它在修改前校验记录中的仓库根目录、完整提交对象名、分支和配置池内的规范目标路径。它只通过 `git worktree remove` 移除缺失目标的未锁定登记;其他 worktree 与锁定登记保持不变。其命令在 Session 的策略下运行,边界是记录中的源检出目录,它包含目标目录,因此自身根就是被删除 worktree 的 Session 也能恢复它。随后在分支仍存在时检出该分支,否则在 `baseCommit` 重新创建同名分支,并通过 `branchRecreated` 报告是哪种情况。目录已存在时会报错。调用方 Session 的工作目录不变,从未提交的修改无法恢复。检出与创建时一样禁用过滤器。`onPhase` 在检查目录、清理登记与创建分支之前收到 `prepare`,在写入文件之前收到 `checkout`;它不能抛出异常。
每次创建都会在目录切换之后向 Session 日志追加一条 `plugin:worktree/created` 事件,因此 `worktree` 投影列出该 Session 的检出目录,位于 fork 继承前缀内的条目 `owned` 为 false。每次进入都会追加一条 `plugin:worktree/entered` 记录,只有 `exit` 读取它:归档 Session 从不移除它只是进入过的检出目录,进入记录也不会让 Session 已离开的检出目录保留下来。Workspace 归档某个 Session 时,服务为该 Session 自己创建的第一个检出目录登记一条 `scheduled` 清理并立即返回;检查在后台进行。`retainOnArchive` 开启时,归档不登记任何清理,所有检出目录都保留;该字段是 volatile 字段,每次归档时读取,[Forge 面板](../client-ui-forge/README.zh.md)在插件页该套件的 worktree 行上以开关编辑它。只要任一未归档 Session 仍引用该目录——通过记录的创建,或通过位于其中的工作目录(祖先子代理已归档的 Session 视为已归档;冷 Session 从投影缓存或其日志读取)——或创建者的沙箱策略为只读,目录就保留。符合条件的目录在路径锁内再做一次使用检查后,用创建者的策略执行不带 force 的 `git worktree remove`,边界是记录中的源检出目录,它包含目标目录;路径锁同时通过 `working-directory/access` 阻塞进入该路径的 `ensure` 与 `set`;分支及其提交保留。跟踪文件改动、未跟踪文件、已初始化的子模块(仓库位于检出目录管理目录的 `modules` 中)、锁、分离 HEAD、分支不匹配以及位于配置池之外的目标都会保留目录。被忽略的文件以及对 skip-worktree 或 assume-unchanged 文件的改动不会:`git status` 不报告这两类内容,Git 删除目录时一并丢弃它们。检查不识别已提交的内嵌仓库;Git 会拒绝这类删除,本次尝试以 `failed` 结束。检查读到 `git status` 的第一条记录即停止,并以流式读取工作树列表,查找该检出目录期间在内存中保留其条目;两者的输出都不受 `maxOutputBytes` 限制。不检查进程:仍在写入的进程会让 Git 拒绝删除,空闲进程的下一条命令会失败。取消归档会取消尚未获准的删除,并等待已获准的删除结束。`cleanupOf(session, revision)` 读取本次尝试,或等待指定修订号结束,状态为 `scheduled`、`retained`、`removed` 或 `failed`;失败时 Session 仍保持归档并记录警告。此事件存在之前创建的检出目录,以及更早归档的 Session,不会被扫描。
每次创建都会在目录切换之后向 Session 日志追加一条 `plugin:worktree/created` 事件,因此 `worktree` 投影列出该 Session 的检出目录,位于 fork 继承前缀内的条目 `owned` 为 false。每次进入都会追加一条 `plugin:worktree/entered` 记录,只有 `exit` 读取它:归档 Session 从不移除它只是进入过的检出目录,进入记录也不会让 Session 已离开的检出目录保留下来。Workspace 归档某个 Session 时,服务为该 Session 自己创建的第一个检出目录登记一条 `scheduled` 清理并立即返回;检查在后台进行。`retainOnArchive` 开启时,归档不登记任何清理,所有检出目录都保留;该字段是 volatile 字段,每次归档时读取,[Forge 面板](../client-ui-forge/README.zh.md)在插件页该套件的 worktree 行上以开关编辑它。只要任一未归档 Session 仍引用该目录——通过记录的创建,或通过位于其中的工作目录(祖先子代理已归档的 Session 视为已归档;冷 Session 从投影缓存或其日志读取)——目录就保留。冷创建者经 `sessionQuery.observeSession` 观察,不会被挂载或恢复运行。归档即用户授权删除该目录,因此清理不读取任何沙箱策略,其 Git 命令不经沙箱执行;只有下述检查约束它。符合条件的目录在路径锁内再做一次使用检查后,在记录中的源检出目录(它包含目标目录)执行不带 force 的 `git worktree remove`;路径锁同时通过 `working-directory/access` 阻塞进入该路径的 `ensure` 与 `set`;分支及其提交保留。跟踪文件改动、未跟踪文件、已初始化的子模块(仓库位于检出目录管理目录的 `modules` 中)、锁、分离 HEAD、分支不匹配以及位于配置池之外的目标都会保留目录。被忽略的文件以及对 skip-worktree 或 assume-unchanged 文件的改动不会:`git status` 不报告这两类内容,Git 删除目录时一并丢弃它们。检查不识别已提交的内嵌仓库;Git 会拒绝这类删除,本次尝试以 `failed` 结束。检查读到 `git status` 的第一条记录即停止,并以流式读取工作树列表,查找该检出目录期间在内存中保留其条目;两者的输出都不受 `maxOutputBytes` 限制。不检查进程:仍在写入的进程会让 Git 拒绝删除,空闲进程的下一条命令会失败。取消归档会取消尚未获准的删除,并等待已获准的删除结束。`cleanupOf(session, revision)` 读取本次尝试,或等待指定修订号结束,状态为 `scheduled`、`retained`、`removed` 或 `failed`;失败时 Session 仍保持归档并记录警告。此事件存在之前创建的检出目录,以及更早归档的 Session,不会被扫描。
预期失败抛出 `WorktreeError`,其 `code` 为:名称被 Git 或池规则拒绝、起始修订为空或恢复记录违反文档约束时为 `WORKTREE_INVALID_ARGUMENT`,Git 无法解析的起始修订或基础提交则以 `WORKTREE_COMMAND_FAILED` 失败;分支或路径已存在时为 `WORKTREE_ALREADY_EXISTS`;登记被锁定时为 `WORKTREE_LOCKED`;进入时名称在池中选不到已登记的工作树为 `WORKTREE_NOT_FOUND`;Session 的目录不在任何已记录工作树内却调用退出时为 `WORKTREE_NOT_ENTERED`;命令以失败状态退出、超过 `maxOutputBytes` 或超过 `timeoutMs` 时分别为 `WORKTREE_COMMAND_FAILED`、`WORKTREE_OUTPUT_TOO_LARGE` 和 `WORKTREE_TIMEOUT`;服务释放后为 `WORKTREE_UNAVAILABLE`。目录分配之后的失败会在消息中加入保留产物的说明,并保留原错误的 `name` 与 `code`;调用方取消仍是 `AbortError`。
@@ -54,7 +54,7 @@ kind: "package-reference"
<details>
<summary>实现细节——点击展开</summary>
Git 与目录分配通过挂载的子进程及沙箱提供方执行,沿用调用 Session 的文件策略。创建操作不会扩大目标目录或共享 Git 管理目录的写权限。目录创建独占申请目标路径;取消或初始化失败可能留下已有产物,错误会包含其路径。服务销毁会中止待完成操作,并等待它们结束。
Git 与目录分配通过挂载的子进程及沙箱提供方执行,沿用调用 Session 的文件策略;归档清理不经沙箱执行。创建操作不会扩大目标目录或共享 Git 管理目录的写权限。目录创建独占申请目标路径;取消或初始化失败可能留下已有产物,错误会包含其路径。服务销毁会中止待完成操作,并等待它们结束。
| 源码 | 职责 |
|---|---|
+47 -38
View File
@@ -5,9 +5,8 @@
*/
import { sep } from 'node:path'
import type { Context } from '@deepseek-ai/cordis'
import type { Session, SessionHeader, SessionId } from '@deepseek-ai/dsh-session'
import type {} from '@deepseek-ai/dsh-sandbox-policy'
import type { ProjectionHandle } from '@deepseek-ai/dsh-session-projection'
import type { SessionHeader, SessionId } from '@deepseek-ai/dsh-session'
import type { ProjectionHandle, SessionProjectionMap } from '@deepseek-ai/dsh-session-projection'
import type {} from '@deepseek-ai/dsh-session-projection-cache'
import type {} from '@deepseek-ai/dsh-session-query'
import type {} from '@deepseek-ai/dsh-working-directory'
@@ -33,10 +32,15 @@ export interface ReclamationHost {
retainOnArchive(): boolean
/** Run `body` after every operation on `path` that was requested earlier, and before any requested later. */
exclusiveCheckout<T>(path: string, body: () => Promise<T>): Promise<T>
/** Inspect and, when eligible and admitted, remove the checkout without force. Rejects on Git failure. */
removeCheckout(session: Session, request: CreatedWorktree, signal: AbortSignal, admit: () => boolean): Promise<boolean>
/**
* Inspect and, when eligible and admitted, remove the checkout without force. Rejects on Git failure.
*/
removeCheckout(request: CreatedWorktree, signal: AbortSignal, admit: () => boolean): Promise<boolean>
}
/** The wire values cleanup reads from an observation; the service injects every owner, so each is always present. */
type Observed = Pick<SessionProjectionMap, 'worktree' | 'workingDirectory'>
interface Attempt {
readonly worktree: CreatedWorktree
readonly revision: number
@@ -66,8 +70,8 @@ export class WorktreeReclamation {
private revision = 0
/**
* @param ctx - scope injecting the Workspace registry, Session query, store, working-directory, and
* sandbox-policy providers; the projection cache is read when mounted.
* @param ctx - scope injecting the Workspace registry, Session query, store, and working-directory
* providers; the projection cache is read when mounted.
* @param host - the service operations the module runs through.
* @param projection - the `worktree` unit, read live and through the persisted cache.
*/
@@ -122,8 +126,8 @@ export class WorktreeReclamation {
private schedule(sessionId: SessionId): void {
if (this.host.retainOnArchive()) return
const live = this.ctx.sessions.get(sessionId)
// A cold Session's creations come from the persisted cache or its log, below.
const owned = live === undefined ? undefined : this.projection.stateOf(live).created.filter(creation => creation.owned)
// A cold Session is observed in the background, below.
const owned = live === undefined ? undefined : ownedOf(this.projection.stateOf(live).created)
if (owned !== undefined && owned.length === 0) return
const attempt: Attempt = {
worktree: owned?.[0]?.worktree ?? { path: '', branch: '', baseCommit: '', repositoryRoot: '' },
@@ -139,7 +143,7 @@ export class WorktreeReclamation {
private async run(sessionId: SessionId, attempt: Attempt, owned: readonly WorktreeCreation[] | undefined): Promise<void> {
const ctx = this.ctx
try {
const creations = owned ?? (await this.creationsOf(sessionId, undefined)).filter(creation => creation.owned)
const creations = owned ?? ownedOf((await this.projected(sessionId)).worktree)
const candidate = creations[0]?.worktree
if (candidate === undefined) {
this.attempts.delete(sessionId)
@@ -149,12 +153,10 @@ export class WorktreeReclamation {
ctx.emit('worktree/cleanup', {
sessionId, path: candidate.path, cleanup: { revision: attempt.revision, status: attempt.status },
})
const session = await this.creatorSession(sessionId)
if (session === undefined || attempt.cancelled || ctx.sandboxPolicy.resolve({ session }).mode === 'read-only'
|| !await this.unused(candidate, sessionId)) {
if (attempt.cancelled || !await this.unused(candidate, sessionId)) {
attempt.status = 'retained'
} else {
attempt.status = await this.remove(session, candidate, attempt) ? 'removed' : 'retained'
attempt.status = await this.remove(candidate, attempt) ? 'removed' : 'retained'
}
} catch (error: unknown) {
attempt.status = 'failed'
@@ -172,10 +174,10 @@ export class WorktreeReclamation {
* competing operations settled. A Session has one attempt and unarchiving
* awaits it, so removals of one path never overlap.
*/
private async remove(session: Session, worktree: CreatedWorktree, attempt: Attempt): Promise<boolean> {
private async remove(worktree: CreatedWorktree, attempt: Attempt): Promise<boolean> {
const operation = this.host.exclusiveCheckout(worktree.path, async () => {
if (attempt.cancelled || !await this.unused(worktree, undefined)) return false
return await this.host.removeCheckout(session, worktree, this.lifetime.signal, () => !attempt.cancelled)
return await this.host.removeCheckout(worktree, this.lifetime.signal, () => !attempt.cancelled)
})
this.removing.set(worktree.path, operation.then(() => {}, () => {}))
try {
@@ -205,39 +207,46 @@ export class WorktreeReclamation {
const id = record.header.id
if (archived.has(id) || ancestorArchived(record.header, headers, archived)) continue
const live = ctx.sessions.get(id)
const cwd = live === undefined ? await this.directoryOf(record.header) : ctx.workingDirectory.get(live)
const { workingDirectory: cwd, worktree: creations } = live === undefined
? await this.usageOf(record.header)
: { workingDirectory: ctx.workingDirectory.get(live), worktree: this.projection.stateOf(live).created }
if (cwd !== null && within(worktree.path, cwd)) return false
const creations = live === undefined ? await this.creationsOf(id, record.header) : this.projection.stateOf(live).created
if (creations.some(creation => creation.worktree.path === worktree.path)) return false
signal.throwIfAborted()
}
return true
}
/** The archived Session itself, prepared cold when not live, whose sandbox policy confines the Git commands. */
private async creatorSession(sessionId: SessionId): Promise<Session | undefined> {
const live = this.ctx.sessions.get(sessionId)
if (live !== undefined) return live
return await this.ctx.sessionQuery.inspectSession(sessionId, session => session, this.lifetime.signal)
/**
* The recorded directory (null when its log recorded none) and creations of a cold Session: the
* persisted cache when it holds both, else one observation of its log.
*/
private async usageOf(header: SessionHeader): Promise<Observed> {
const cached = this.ctx.get('sessionProjectionCache')?.cachedSnapshot(header, ['workingDirectory', 'worktree'])?.values
if (cached?.workingDirectory !== undefined && cached.worktree !== undefined) {
return { workingDirectory: cached.workingDirectory, worktree: cached.worktree }
}
return await this.projected(header.id)
}
/** The recorded directory of a cold Session, null when its log recorded none: the persisted cache when it has one, else its log. */
private async directoryOf(header: SessionHeader): Promise<string | null> {
const cached = this.ctx.get('sessionProjectionCache')?.cachedSnapshot(header, ['workingDirectory'])?.values.workingDirectory
if (cached !== undefined) return cached
return await this.ctx.sessionQuery.inspectSession(header.id, session => this.ctx.workingDirectory.get(session), this.lifetime.signal)
/**
* The read wire values of a Session at its log end; observing a cold Session neither attaches nor resumes it.
* @throws when an injected owner's value is missing, which a misassembled projection registry would cause.
*/
private async projected(sessionId: SessionId): Promise<Observed> {
using observation = await this.ctx.sessionQuery.observeSession(sessionId, { signal: this.lifetime.signal })
const values = observation.projections?.values
/* v8 ignore next 3 -- the service injects the registry and every owner read here, so each value is registered. */
if (values?.worktree === undefined || values.workingDirectory === undefined) {
throw new Error(`worktree: the observation of Session ${sessionId} lacks a projected value`)
}
return { worktree: values.worktree, workingDirectory: values.workingDirectory }
}
}
/** The recorded creations of a cold Session: the persisted cache when it has one, else its log. */
private async creationsOf(
sessionId: SessionId, header: SessionHeader | undefined,
): Promise<readonly WorktreeCreation[]> {
const cached = header === undefined
? undefined
: this.ctx.get('sessionProjectionCache')?.cachedSnapshot(header, ['worktree'])?.values.worktree
if (cached !== undefined) return cached
return await this.ctx.sessionQuery.inspectSession(sessionId, session => this.projection.stateOf(session).created, this.lifetime.signal)
}
/** The creations the Session made itself, not those a fork inherited. */
function ownedOf(creations: readonly WorktreeCreation[]): readonly WorktreeCreation[] {
return creations.filter(creation => creation.owned)
}
/** Whether any subagent ancestor of `header`, followed through the listed headers, is archived. */
+10 -10
View File
@@ -147,11 +147,11 @@ export class WorktreeService extends Service {
this.projection = await this.ctx.sessionProjections.register(worktreeProjection)
// Reclamation needs the Workspace archive events and the Session corpus; without
// them the service only creates and restores, as a headless profile composes it.
this.ctx.inject(['workspaceRegistry', 'sessionQuery', 'sessions', 'workingDirectory', 'sandboxPolicy'], (scope) => {
this.ctx.inject(['workspaceRegistry', 'sessionQuery', 'sessions', 'workingDirectory'], (scope) => {
const reclamation = new WorktreeReclamation(scope, {
retainOnArchive: () => this.config.retainOnArchive.get(),
exclusiveCheckout: (path, body) => this.exclusiveCheckout(path, body),
removeCheckout: (session, request, signal, admit) => this.removeCheckout(session, request, signal, admit),
removeCheckout: (request, signal, admit) => this.removeCheckout(request, signal, admit),
}, this.projection)
this.reclamation = reclamation
scope.effect(() => () => { this.reclamation = undefined })
@@ -292,16 +292,16 @@ export class WorktreeService extends Service {
}
/**
* Inspect a recorded checkout under the Session's policy and, when eligible
* and admitted, remove it and its registration without force or branch
* deletion. A rejection can leave a partial directory; the branch stays.
* Inspect a recorded checkout and, when eligible and admitted, remove it and
* its registration without force or branch deletion. Archiving is the user's
* authorization, so Git runs unconfined by any Session's sandbox policy; the
* inspection bounds it to a clean checkout of the configured pool registered
* on the recorded branch. A rejection can leave a partial directory; the branch stays.
*/
private async removeCheckout(
session: Session, request: RestoreWorktreeRequest, signal: AbortSignal, admit: () => boolean,
): Promise<boolean> {
private async removeCheckout(request: RestoreWorktreeRequest, signal: AbortSignal, admit: () => boolean): Promise<boolean> {
const control = AbortSignal.any([this.lifetime.signal, signal])
control.throwIfAborted()
const policy = this.sourcePolicy(session, request.repositoryRoot)
const policy: SandboxExecutionPolicy = { mode: 'danger-full-access', workspaceRoot: request.repositoryRoot }
const git = { read: this.gitRunner(policy, control), scan: this.gitScanner(policy, control) }
const operation = removeCheckout(this.ctx, this.config.directory, request, git, control, admit)
this.pending.add(operation)
@@ -438,7 +438,7 @@ export class WorktreeService extends Service {
}
/**
* The policy removal and restoration run under: the Session's mode and grants, bounded by the source
* The policy restoration runs under: the Session's mode and grants, bounded by the source
* checkout of the recorded worktree instead of the Session's own root, which may be the worktree
* directory, removed or being removed.
*/
@@ -91,7 +91,7 @@ export async function registration(
* @param ctx - execution-world filesystem provider.
* @param directory - configured relative worktree pool.
* @param request - saved checkout identity.
* @param git - confined Git runners with the owner's policy.
* @param git - Git runners under the policy the caller chose.
* @param signal - cancellation before or during removal.
* @param admit - synchronous final admission after inspection; false retains the checkout.
* @returns true when removed; false when inspection or admission retains it; Git failures reject.
@@ -117,7 +117,7 @@ export async function removeCheckout(
* @param ctx - execution-world filesystem provider.
* @param directory - configured relative worktree pool.
* @param request - saved checkout identity.
* @param git - confined Git runners with the owner's policy.
* @param git - Git runners under the policy the caller chose.
* @param signal - cancellation of inspection.
* @returns false for an ineligible checkout; inspection failures reject.
*/
@@ -6,6 +6,7 @@ import AgentRegistry from '@deepseek-ai/dsh-agent'
import type { Agent } from '@deepseek-ai/dsh-agent'
import { unsupportedInbox, unsupportedModel } from '@deepseek-ai/dsh-agent-loop-testkit'
import LocalFileSystem from '@deepseek-ai/dsh-fs-local'
import type { ConfinedArgv, SandboxMode } from '@deepseek-ai/dsh-sandbox'
import SandboxPolicyService from '@deepseek-ai/dsh-sandbox-policy'
import SessionStore, { appendPluginRecord, type SessionId, SessionLogOffset } from '@deepseek-ai/dsh-session'
import type { Session } from '@deepseek-ai/dsh-session'
@@ -65,7 +66,14 @@ function agentFor(ctx: Context, session: Session): Agent {
return agent
}
async function fixture(options: { cache?: boolean; retainOnArchive?: boolean; maxOutputBytes?: number } = {}) {
async function fixture(options: {
cache?: boolean
retainOnArchive?: boolean
maxOutputBytes?: number
mode?: SandboxMode
/** Point the deployment's default directory inside the checkout the fixture creates. */
defaultInWorktree?: boolean
} = {}) {
const temporary = await realpath(await mkdtemp(join(tmpdir(), 'dsh-worktree-archive-')))
cleanups.push(() => rm(temporary, { recursive: true, force: true }))
const root = await repository(temporary)
@@ -78,8 +86,13 @@ async function fixture(options: { cache?: boolean; retainOnArchive?: boolean; ma
await ctx.plugin(LocalFileSystem, { cwd: root })
await ctx.plugin(LocalSubprocessRuntime)
await ctx.plugin(UnusedSandbox)
await ctx.plugin(SandboxPolicyService, { mode: 'danger-full-access', workspaceRoot: root })
await ctx.plugin(WorkingDirectoryService)
// A confined default records each policy and runs the command unconfined.
const confine = vi.spyOn(ctx.sandbox, 'confine')
if (options.mode !== undefined) confine.mockImplementation(async argv => ({ argv: [...argv] }) as ConfinedArgv)
await ctx.plugin(SandboxPolicyService, { mode: options.mode ?? 'danger-full-access', workspaceRoot: root })
await ctx.plugin(WorkingDirectoryService, options.defaultInWorktree === true
? { defaultDirectory: join(root, '.agents', 'worktrees', 'archive-me') }
: {})
await ctx.plugin(SessionPersistence, { root: join(temporary, 'sessions'), compression: 'none' })
await ctx.plugin(ArchiveQueries)
await ctx.plugin(Storage)
@@ -89,14 +102,14 @@ async function fixture(options: { cache?: boolean; retainOnArchive?: boolean; ma
ctx.provide('storageDomain', domain)
if (options.cache === true) await ctx.plugin(SessionProjectionCache, { writeEveryEvents: 1_000, writeIntervalMs: 60_000 })
await ctx.plugin(WorkspaceRegistry)
const { cache: _cache, ...config } = options
const { cache: _cache, mode: _mode, defaultInWorktree: _defaultInWorktree, ...config } = options
const worktrees = ctx.plugin(WorktreeService, config)
await worktrees
const session = ctx.sessions.create(brandString<SessionId>('archive-owner'), { meta: { cwd: root } })
const agent = agentFor(ctx, session)
await ctx.agents.register(agent)
const worktree = await ctx.worktrees.create(agent, { name: 'archive-me' })
return { ctx, root, session, agent, worktree, temporary, worktrees }
return { ctx, root, session, agent, worktree, temporary, worktrees, confine }
}
type Fixture = Awaited<ReturnType<typeof fixture>>
@@ -108,20 +121,45 @@ async function settled(f: Fixture, session: Session = f.session): Promise<Worktr
}
async function persisted(f: Fixture, session: Session): Promise<void> {
await using writer = await f.ctx.sessionPersistence.create(session.header)
const inherited = session.inheritedEventCount
await using writer = await f.ctx.sessionPersistence.create(session.header, inherited === 0 ? {} : { inheritedEventCount: inherited })
await writer.append(session.snapshotEvents())
await writer.flush()
await writer.close()
}
/** A live Session whose store entry the test detaches itself, leaving only its persisted log. */
function detachable(f: Fixture, id: string, meta: { cwd?: string }): { session: Session; detach: () => void } {
const session = f.ctx.sessions.prepare(brandString<SessionId>(id), { meta })
function detachable(
f: Fixture, id: string, meta: { cwd?: string; isSeeded?: boolean }, fork?: Session,
): { session: Session; detach: () => void } {
const seed = fork?.snapshotEvents()
const session = f.ctx.sessions.prepare(brandString<SessionId>(id), {
meta, ...seed === undefined ? {} : { seed, inheritedEventCount: SessionLogOffset(seed.length) },
})
const detach = f.ctx.sessions.enter(session)
f.ctx.sessions.announce(session)
return { session, detach }
}
/**
* A Session that created a checkout, optionally recorded a sandbox mode, and
* went cold: persisted, its Agent unregistered, and its store entry detached.
*/
async function coldCreator(f: Fixture, id: string, options: { mode?: SandboxMode; cache?: boolean } = {}) {
const owner = detachable(f, id, { cwd: f.root })
const agent = agentFor(f.ctx, owner.session)
const registration = f.ctx.agents.register(agent)
await registration
const worktree = await f.ctx.worktrees.create(agent, { name: id })
if (options.mode !== undefined) owner.session.append('sandbox/mode', { mode: options.mode })
if (options.cache === true) await f.ctx.sessionProjectionCache.write(owner.session)
await persisted(f, owner.session)
await registration()
owner.detach()
expect(f.ctx.sessions.get(owner.session.id)).toBeUndefined()
return { session: owner.session, worktree }
}
describe('archive-triggered worktree cleanup', () => {
it('removes the clean checkout the archived Session created and keeps its branch and commits', async () => {
const f = await fixture()
@@ -138,7 +176,7 @@ describe('archive-triggered worktree cleanup', () => {
await expect(access(f.worktree.path)).rejects.toMatchObject({ code: 'ENOENT' })
expect(await git(f.root, 'rev-parse', f.worktree.branch)).toBe(head)
expect(f.ctx.workspaceRegistry.archivedSessionIds).toContain(f.session.id)
// The creator's root is the checkout being removed; `sandbox.spec.ts` covers the source-checkout boundary of its commands.
// The creator's root is the checkout being removed.
expect(f.ctx.workingDirectory.get(f.session)).toBe(f.worktree.path)
})
@@ -276,30 +314,54 @@ describe('archive-triggered worktree cleanup', () => {
expect(await settled(f)).toMatchObject({ status: 'retained' })
})
it('removes a persisted checkout without loading its Agent, reading cold Sessions from the projection cache when present', async () => {
const f = await fixture({ cache: true })
const owner = detachable(f, 'cold-owner', { cwd: f.root })
const agent = agentFor(f.ctx, owner.session)
const registration = f.ctx.agents.register(agent)
await registration
const worktree = await f.ctx.worktrees.create(agent, { name: 'cold-ui' })
it.each([
['its log', false],
['the projection cache', true],
])('removes a cold creator\'s checkout through one observation from %s without attaching it', async (_source, cache) => {
const f = await fixture({ cache })
const owner = await coldCreator(f, 'cold-owner', { cache })
const bystander = detachable(f, 'cold-bystander', { cwd: f.root })
await f.ctx.sessionProjectionCache.write(owner.session)
await f.ctx.sessionProjectionCache.write(bystander.session)
await persisted(f, owner.session)
if (cache) await f.ctx.sessionProjectionCache.write(bystander.session)
await persisted(f, bystander.session)
await registration()
owner.detach()
bystander.detach()
expect(f.ctx.sessions.get(owner.session.id)).toBeUndefined()
const inspect = vi.spyOn(f.ctx.sessionQuery, 'inspectSession')
const attached: SessionId[] = []
f.ctx.on('session/created', (session) => { attached.push(session.id) })
f.ctx.on('worktree/cleanup', () => { attached.push(...f.ctx.sessions.get(owner.session.id) === undefined ? [] : [owner.session.id]) })
const observe = vi.spyOn(f.ctx.sessionQuery, 'observeSession')
await f.ctx.workspaceRegistry.archiveSession(owner.session.id)
expect(await settled(f, owner.session)).toMatchObject({ status: 'removed' })
// The creator is prepared once for its own creations and policy; the cached bystander never is.
expect(inspect.mock.calls.map(call => call[0])).toEqual([owner.session.id, owner.session.id])
// The creator is observed once for its creations. An uncached bystander is observed once by the
// eligibility check and once by the locked recheck; a cached one never is.
const reads = cache ? [] : Array<SessionId>(2).fill(bystander.session.id)
expect(observe.mock.calls.map(call => call[0])).toEqual([owner.session.id, ...reads])
expect(attached).toEqual([])
expect(f.ctx.sessions.get(owner.session.id)).toBeUndefined()
expect(f.ctx.agents.list().some(agent => agent.session.id === owner.session.id)).toBe(false)
await expect(access(worktree.path)).rejects.toMatchObject({ code: 'ENOENT' })
await expect(access(owner.worktree.path)).rejects.toMatchObject({ code: 'ENOENT' })
})
it.each([
['a live', false],
['a cold', true],
])('removes %s creator\'s checkout unconfined even under a recorded read-only mode and a confined default', async (_kind, cold) => {
const f = await fixture({ mode: 'read-only' })
if (!cold) f.session.append('sandbox/mode', { mode: 'read-only' })
const owner = cold ? await coldCreator(f, 'cold-read-only', { mode: 'read-only' }) : f
f.confine.mockClear()
await f.ctx.workspaceRegistry.archiveSession(owner.session.id)
expect(await settled(f, owner.session)).toMatchObject({ status: 'removed' })
expect(f.confine).not.toHaveBeenCalled()
await expect(access(owner.worktree.path)).rejects.toMatchObject({ code: 'ENOENT' })
})
it('retains a checkout while a cold fork still carries its creation', async () => {
const f = await fixture()
const fork = detachable(f, 'cold-fork', { cwd: f.root, isSeeded: true }, f.session)
await persisted(f, fork.session)
fork.detach()
await f.ctx.workspaceRegistry.archiveSession(f.session.id)
expect(await settled(f)).toMatchObject({ status: 'retained' })
await access(f.worktree.path)
})
it('retains a checkout while a live fork that moved elsewhere still carries its creation', async () => {
@@ -317,10 +379,15 @@ describe('archive-triggered worktree cleanup', () => {
expect(removeCheckout).not.toHaveBeenCalled()
})
it('treats a cached cold Session that recorded no directory as working nowhere', async () => {
const f = await fixture({ cache: true })
it.each([
['cached', true],
['uncached', false],
])('treats a %s cold Session that recorded no directory as working nowhere, not in the default directory', async (_source, cache) => {
// The default directory lies inside the checkout, so reading it for an unrecorded directory would retain the checkout.
const f = await fixture({ cache, defaultInWorktree: true })
expect(f.ctx.workingDirectory.defaultDirectory).toBe(f.worktree.path)
const nowhere = detachable(f, 'cold-nowhere', {})
await f.ctx.sessionProjectionCache.write(nowhere.session)
if (cache) await f.ctx.sessionProjectionCache.write(nowhere.session)
await persisted(f, nowhere.session)
nowhere.detach()
await f.ctx.workspaceRegistry.archiveSession(f.session.id)
@@ -344,14 +411,6 @@ describe('archive-triggered worktree cleanup', () => {
expect(await settled(f)).toMatchObject({ status: 'removed' })
})
it('retains a checkout under its creator\'s read-only policy', async () => {
const f = await fixture()
f.session.append('sandbox/mode', { mode: 'read-only' })
await f.ctx.workspaceRegistry.archiveSession(f.session.id)
expect(await settled(f)).toMatchObject({ status: 'retained' })
await access(f.worktree.path)
})
it('keeps the archive and reports a failed removal', async () => {
const f = await fixture()
const warning = vi.spyOn(f.ctx.logger, 'warn').mockImplementation(() => {})
@@ -3680,12 +3680,6 @@ export const SERVICE_API: readonly ServiceApiEntry[] = [
parameters: [{ name: 'sessionId', description: 'logical Session identity.' }, { name: 'options', description: 'cancellation and projection selection for this read.' }],
returns: 'a caller-owned observation lease.',
},
{
signature: 'inspectSession<T>(sessionId: SessionId, read: (session: Session) => T, signal?: AbortSignal): Promise<T>',
description: 'Inspect domain-owned state without attaching or resuming a cold Session. The getter runs synchronously after preparation and must not mutate or retain the Session.',
parameters: [{ name: 'sessionId', description: 'logical Session identity.' }, { name: 'read', description: 'domain getter returning detached data.' }, { name: 'signal', description: 'preparation cancellation.' }],
returns: 'the getter\'s value at the current live or prepared cut.',
},
{
signature: 'abstract searchSessions( request: SessionSearchRequest, exec?: SessionSearchExecContext, ): Promise<SessionSearchPage<SessionSearchHit>>',
description: 'Search the live-preferred logical corpus and group by session.',
+47 -6
View File
@@ -1,5 +1,6 @@
/** DeepSeek Files API transport. @module dsh-llm-deepseek/files-api */
import { randomUUID } from 'node:crypto'
import { attributionHeaders, LlmError } from '@deepseek-ai/dsh-llm'
import type { ImageMediaType } from '@deepseek-ai/dsh-attachment'
import { brandString } from '@deepseek-ai/dsh-brand'
@@ -130,6 +131,44 @@ function providerErrorDetail(value: unknown): { message?: string; detail: string
}
}
/**
* Encode the upload as one `multipart/form-data` byte array (RFC 7578).
*
* `fetch` receives bytes instead of a `FormData`: Node's `fetch` copies a `FormData` body into the request stream from a
* detached task, and a request cancelled while that task runs fails it as an unhandled rejection.
*/
function multipartUpload(boundary: string, input: {
data: Uint8Array
mediaType: ImageMediaType
filename: string
expiresAfterSeconds: number
}): Uint8Array<ArrayBuffer> {
const encoder = new TextEncoder()
// The escapes of the WHATWG multipart/form-data encoding keep the filename inside its quoted header value.
const filename = input.filename.replaceAll('"', '%22').replaceAll('\r', '%0D').replaceAll('\n', '%0A')
const head = encoder.encode([
`--${boundary}`,
'Content-Disposition: form-data; name="expires_after[anchor]"',
'',
'created_at',
`--${boundary}`,
'Content-Disposition: form-data; name="expires_after[seconds]"',
'',
String(input.expiresAfterSeconds),
`--${boundary}`,
`Content-Disposition: form-data; name="file"; filename="${filename}"`,
`Content-Type: ${input.mediaType}`,
'',
'',
].join('\r\n'))
const tail = encoder.encode(`\r\n--${boundary}--\r\n`)
const body = new Uint8Array(head.byteLength + input.data.byteLength + tail.byteLength)
body.set(head)
body.set(input.data, head.byteLength)
body.set(tail, head.byteLength + input.data.byteLength)
return body
}
/** Direct Files client retaining the configured URL root and refusing redirects before credentials can leave its origin. */
export class DeepSeekFilesClient {
private readonly baseURL: string
@@ -148,7 +187,8 @@ export class DeepSeekFilesClient {
private async request(path: string, init: RequestInit, signal?: AbortSignal): Promise<Response> {
let response: Response
try {
const headers = new Headers(attributionHeaders())
const headers = new Headers(init.headers)
for (const [name, value] of Object.entries(attributionHeaders())) headers.set(name, value)
for (const [name, value] of Object.entries(this.authHeaders)) headers.set(name, value)
headers.set('anthropic-version', '2023-06-01')
headers.set('anthropic-beta', MESSAGES_FILES_BETA)
@@ -199,11 +239,12 @@ export class DeepSeekFilesClient {
|| input.expiresAfterSeconds > MAX_FILE_EXPIRY_SECONDS) {
throw new LlmError('DeepSeek file expiry must be between 3600 and 2592000 seconds.', 'INVALID_REQUEST')
}
const form = new FormData()
form.set('expires_after[anchor]', 'created_at')
form.set('expires_after[seconds]', String(input.expiresAfterSeconds))
form.set('file', new Blob([Uint8Array.from(input.data).buffer], { type: input.mediaType }), input.filename)
const response = await this.request('/files', { method: 'POST', body: form }, input.signal)
const boundary = `----dsh-${randomUUID()}`
const response = await this.request('/files', {
method: 'POST',
headers: { 'content-type': `multipart/form-data; boundary=${boundary}` },
body: multipartUpload(boundary, input),
}, input.signal)
const file = parseFileObject(await responseJson(response, 'upload'), 'upload')
return { ...file, expiresAt: file.createdAt + input.expiresAfterSeconds }
}
@@ -10,7 +10,7 @@ import { TimeoutReason } from '@deepseek-ai/dsh-timeout'
import { DeepSeekFileStore, FILES_API_TIMEOUT, MAX_IMAGE_BYTES } from '../src/file-store.ts'
import type { DeepSeekFileId } from '../src/file-id.ts'
import { deepSeekFileScope, DeepSeekUploadIndex } from '../src/upload-index.ts'
import { adapter, chunks, options, requestImageStore, server, user } from './helpers.ts'
import { adapter, chunks, options, requestImageStore, server, uploadedForm, user } from './helpers.ts'
vi.mock('node:timers/promises', { spy: true })
@@ -630,12 +630,11 @@ describe('DeepSeekFileStore', () => {
fetch: remote.fetchImpl,
})
await store.ensureUploaded({ ...VERSION, mediaType }, CONNECTION, POLICY)
const form = vi.mocked(remote.fetchImpl).mock.calls[0]?.[1]?.body
expect(form).toBeInstanceOf(FormData)
const file = (form as FormData).get('file')
expect(file).toBeInstanceOf(File)
const form = await uploadedForm(vi.mocked(remote.fetchImpl).mock.calls[0]?.[1])
const file = form.get('file')
if (!(file instanceof File)) throw new Error('expected multipart file')
expect(file.name).toMatch(new RegExp(`\\.${extension}$`, 'u'))
expect(file.type).toBe(mediaType)
})
it('normalizes a non-Error failure from the durable upload index', async () => {
@@ -10,6 +10,7 @@ import {
isFilesQuotaError,
MAX_FILE_UPLOAD_BYTES,
} from '../src/files-api.ts'
import { uploadedForm } from './helpers.ts'
function requestUrl(input: string | URL | Request): string {
if (typeof input === 'string') return input
@@ -67,7 +68,7 @@ describe('DeepSeekFilesClient', () => {
expect(headers.get('anthropic-version')).toBe('2023-06-01')
expect(headers.get('anthropic-beta')).toBe('files-api-2025-04-14')
expect(headers.has('authorization')).toBe(false)
const form = init?.body as FormData
const form = await uploadedForm(init)
expect(form.get('purpose')).toBeNull()
expect(form.get('expires_after[anchor]')).toBe('created_at')
expect(form.get('expires_after[seconds]')).toBe('3600')
@@ -179,15 +180,16 @@ describe('DeepSeekFilesClient', () => {
const headers = new Headers(init?.headers)
expect(headers.get('x-api-key')).toBe('key')
expect(headers.get('user-agent')).toBe(userAgent())
const form = init?.body
expect(form).toBeInstanceOf(FormData)
if (!(form instanceof FormData)) throw new Error('expected multipart body')
expect(form.get('purpose')).toBeNull()
expect(headers.get('content-type')).toMatch(/^multipart\/form-data; boundary=/u)
const form = await uploadedForm(init)
expect([...form.keys()]).toEqual(['expires_after[anchor]', 'expires_after[seconds]', 'file'])
expect(form.get('expires_after[anchor]')).toBe('created_at')
expect(form.get('expires_after[seconds]')).toBe('604800')
const blob = form.get('file')
expect(blob).toBeInstanceOf(Blob)
expect((blob as Blob).size).toBe(3)
const uploaded = form.get('file')
if (!(uploaded instanceof File)) throw new Error('expected multipart file')
expect(uploaded.name).toBe('image.png')
expect(uploaded.type).toBe('image/png')
expect([...await uploaded.bytes()]).toEqual([1, 2, 3])
return new Response(JSON.stringify(file()), { status: 200 })
}) as typeof fetch
const client = new DeepSeekFilesClient({ baseURL: 'https://api.deepseek.com/', headers: { 'x-api-key': 'key' }, fetch: fetchImpl })
@@ -206,6 +208,22 @@ describe('DeepSeekFilesClient', () => {
})
})
it('keeps a filename with quotes and line breaks inside its multipart header', async () => {
const fetchImpl = vi.fn<typeof fetch>(async () => new Response(JSON.stringify(file())))
const client = new DeepSeekFilesClient({ baseURL: 'https://api.deepseek.com/', headers: { 'x-api-key': 'key' }, fetch: fetchImpl })
await client.upload({
data: Uint8Array.of(1, 2, 3), mediaType: 'image/png', filename: 'a"b\r\nc.png', expiresAfterSeconds: 3_600,
})
const form = await uploadedForm(fetchImpl.mock.calls[0]![1])
expect([...form.keys()]).toEqual(['expires_after[anchor]', 'expires_after[seconds]', 'file'])
const uploaded = form.get('file')
if (!(uploaded instanceof File)) throw new Error('expected multipart file')
expect(uploaded.name).toBe('a"b\r\nc.png')
expect([...await uploaded.bytes()]).toEqual([1, 2, 3])
})
it('validates list, retrieve, and delete responses', async () => {
const fetchImpl = vi.fn(async (url: string | URL | Request, init?: RequestInit) => {
const target = requestUrl(url)
Loaded 100 of 223 files, more files were not shown because too many files have changed in this diff. Show more