Merge remote-tracking branch 'origin/master' into feat/client-review-page-seams
# Conflicts: # packages/client/ui-primitives/README.i18n.yaml
This commit is contained in:
commit
e82924c646
300 files changed
+2891
-4883
No files matched your search
+2
-2
@@ -30,8 +30,8 @@
|
||||
en: 99ee505e82fa9c7c
|
||||
zh: 448bc0e160424cbf
|
||||
/agent-note-boot-the-preview-worker-from-the-shipped-profile-and-fetch-lazy-chunks-on-demand/consequences:
|
||||
en: 53d72faa09e78410
|
||||
zh: a5224e4662a4846b
|
||||
en: ed424571c81bcb91
|
||||
zh: 9b79bf03741c1c21
|
||||
/agent-note-boot-the-preview-worker-from-the-shipped-profile-and-fetch-lazy-chunks-on-demand/testing:
|
||||
en: 532918df1acd147d
|
||||
zh: e476c090d183d0a4
|
||||
+1
-1
@@ -81,7 +81,7 @@ The Worker's structural stubs throw errors carrying `ERR_FEATURE_UNAVAILABLE_ON_
|
||||
|
||||
## Consequences
|
||||
|
||||
The Preview boots the composition the served Web deployment boots. With no bundle enabled, the Worker composition differs from the served Web composition only by the jsonl platform override, and enabling any bundle skips no patch. The Plugins page and Settings → Built-in plugins list every `OPTIONAL_BUNDLES` entry with its title and icon and no metadata error. Switching each of the 11 optional bundles on and then off returns `applied` both times; after enabling, every enabled row it changes is active, and after disabling, the plugin list returns to its prior rows. Enabling session-titles disables `@deepseek-ai/dsh-session-title-first-prompt-llm` (row `session-title-llm`) and enables `@deepseek-ai/dsh-session-title-all-prompts-llm`, as in the served Web deployment; enabling inspector-profile runs Session Inspector and starts the NodeJS Inspector degraded. Degradation requires `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`, so a served `dsh web` runs the full Inspector.
|
||||
The Preview boots the composition the served Web deployment boots. With no bundle enabled, the Worker composition differs from the served Web composition only by the jsonl platform override, and enabling any bundle skips no patch. The Plugins page lists every `OPTIONAL_BUNDLES` entry with its title and icon and no metadata error. Switching each of the 11 optional bundles on and then off returns `applied` both times; after enabling, every enabled row it changes is active, and after disabling, the plugin list returns to its prior rows. Enabling session-titles disables `@deepseek-ai/dsh-session-title-first-prompt-llm` (row `session-title-llm`) and enables `@deepseek-ai/dsh-session-title-all-prompts-llm`, as in the served Web deployment; enabling inspector-profile runs Session Inspector and starts the NodeJS Inspector degraded. Degradation requires `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`, so a served `dsh web` runs the full Inspector.
|
||||
|
||||
Size (MiB, measured): the base image is 9.20 (12.79 with pack-time composition and eager chunks, −28%) including 11 optional bundles, plus 5 lazy tar archives totaling 4.45 (pdf 2.88, excel 1.39, terminal 0.13, frontmatter 0.05, Inspector bottom panel 0.00). The base image contains no lazily loaded chunk, and the page fetches an archive only when it requests the chunk.
|
||||
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ Worker 的结构化 stub 抛出带 `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` 的错
|
||||
|
||||
## 后果
|
||||
|
||||
Preview 启动的组合与正式 Web 相同。不开 bundle 时,Worker 组合与正式 Web 只差 jsonl 的平台覆盖;开任一 bundle 都没有被跳过的补丁。插件页和“设置 → 内置插件”列出全部 `OPTIONAL_BUNDLES`,每个都显示标题和图标,没有元信息错误。11 个 optional bundle 逐个开启再关闭,两次都返回 `applied`;开启后它改动的每个启用行都是 active,关闭后插件列表恢复原样。启用 session-titles 会禁用 `@deepseek-ai/dsh-session-title-first-prompt-llm`(行 `session-title-llm`)并启用 `@deepseek-ai/dsh-session-title-all-prompts-llm`,与正式 Web 一致;启用 inspector-profile 后 Session Inspector 运行,NodeJS Inspector 降级启动。降级以 `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` 为前提,所以正常 `dsh web` 运行完整的 Inspector。
|
||||
Preview 启动的组合与正式 Web 相同。不开 bundle 时,Worker 组合与正式 Web 只差 jsonl 的平台覆盖;开任一 bundle 都没有被跳过的补丁。插件页列出全部 `OPTIONAL_BUNDLES`,每个都显示标题和图标,没有元信息错误。11 个 optional bundle 逐个开启再关闭,两次都返回 `applied`;开启后它改动的每个启用行都是 active,关闭后插件列表恢复原样。启用 session-titles 会禁用 `@deepseek-ai/dsh-session-title-first-prompt-llm`(行 `session-title-llm`)并启用 `@deepseek-ai/dsh-session-title-all-prompts-llm`,与正式 Web 一致;启用 inspector-profile 后 Session Inspector 运行,NodeJS Inspector 降级启动。降级以 `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` 为前提,所以正常 `dsh web` 运行完整的 Inspector。
|
||||
|
||||
体积(MiB,实测):基础镜像 9.20(打包期组合且 chunk 随启动下载时为 12.79,−28%),含 11 个 optional bundle;另有 5 个 lazy tar 共 4.45(pdf 2.88、excel 1.39、terminal 0.13、frontmatter 0.05、inspector 底部面板 0.00)。基础镜像不含懒加载 chunk,页面请求 chunk 时才拉取对应 archive。
|
||||
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
* Daily stale pull-request reminders for the `Stale pull requests` workflow.
|
||||
*
|
||||
* A pull request's last activity is the latest of its creation, a commit, a force push, a reopen or ready-for-review
|
||||
* event, and a comment or review from a non-bot account. Other timeline events, such as mentions, labels and cross
|
||||
* references, do not count, so reminder comments never extend it. After 7 and 14 days without activity the workflow
|
||||
* comments once per stage and mentions the author. Activity starts a new cycle. Pull requests labelled `DO_NOT_CLOSE`
|
||||
* and pull requests opened by bots receive no reminders. The workflow never closes pull requests.
|
||||
*
|
||||
* Each run reads the timeline of every open pull request that is neither exempt nor bot-authored, because `updated_at`
|
||||
* also changes on events that are not activity. Each run posts at most `MAX_COMMENTS_PER_RUN` reminders, least recently
|
||||
* updated pull requests first, so a backlog spreads over several days within GitHub's content-creation limits. A failed
|
||||
* pull request is reported and skipped.
|
||||
*/
|
||||
|
||||
/** Label that exempts a pull request from reminders. */
|
||||
export const EXEMPT_LABEL = 'DO_NOT_CLOSE'
|
||||
|
||||
/** Days without activity after which each reminder is posted, in ascending order. */
|
||||
export const REMINDER_DAYS = [7, 14]
|
||||
|
||||
const DAY_MS = 24 * 60 * 60 * 1000
|
||||
// GitHub asks integrations to wait at least one second between content-creating requests.
|
||||
const COMMENT_INTERVAL_MS = 1000
|
||||
const MAX_COMMENTS_PER_RUN = 100
|
||||
const MARKER = /<!-- stale-pr-reminder:(\d+) -->/
|
||||
// Review bots that use ordinary user accounts.
|
||||
const BOT_LOGINS = new Set(['ds-review-bot'])
|
||||
|
||||
const isBot = account => account?.type === 'Bot' || (account?.login ?? '').endsWith('[bot]') || BOT_LOGINS.has(account?.login)
|
||||
|
||||
/**
|
||||
* Returns the timestamps a timeline event contributes to the last activity.
|
||||
* @param {object} event GitHub issue timeline event.
|
||||
* @returns {string[]} ISO timestamps; empty for bot activity and events that are not activity.
|
||||
*/
|
||||
function activityTimes(event) {
|
||||
switch (event.event) {
|
||||
case 'committed':
|
||||
return [event.committer?.date].filter(Boolean)
|
||||
case 'head_ref_force_pushed':
|
||||
case 'reopened':
|
||||
case 'ready_for_review':
|
||||
return [event.created_at]
|
||||
case 'commented':
|
||||
return isBot(event.actor) ? [] : [event.created_at]
|
||||
case 'line-commented':
|
||||
case 'commit-commented':
|
||||
return (event.comments ?? []).filter(comment => !isBot(comment.user)).map(comment => comment.created_at)
|
||||
case 'reviewed':
|
||||
return isBot(event.user) ? [] : [event.submitted_at]
|
||||
default:
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects the reminder a pull request is due for.
|
||||
* @param {object} options
|
||||
* @param {string} options.createdAt Pull-request creation time.
|
||||
* @param {object[]} options.timeline Complete issue timeline of the pull request.
|
||||
* @param {Date} options.now Evaluation time.
|
||||
* @returns {number | undefined} Due reminder stage in days, or `undefined` when none is due.
|
||||
*/
|
||||
export function dueReminder({ createdAt, timeline, now }) {
|
||||
const times = [createdAt, ...timeline.flatMap(activityTimes)].map(time => Date.parse(time)).filter(Number.isFinite)
|
||||
const lastActivity = Math.max(...times)
|
||||
const due = REMINDER_DAYS.filter(days => now.getTime() - lastActivity >= days * DAY_MS).at(-1)
|
||||
if (due === undefined) return undefined
|
||||
const sent = timeline
|
||||
.filter(event => event.event === 'commented' && isBot(event.actor) && Date.parse(event.created_at) > lastActivity)
|
||||
.map(event => Number(MARKER.exec(event.body ?? '')?.[1]))
|
||||
return sent.some(days => days >= due) ? undefined : due
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the reminder comment.
|
||||
* @param {string} author Pull-request author login.
|
||||
* @param {number} days Reminder stage in days.
|
||||
* @returns {string} Comment body.
|
||||
*/
|
||||
export function reminderBody(author, days) {
|
||||
return [
|
||||
`<!-- stale-pr-reminder:${days} -->`,
|
||||
`@${author} This pull request has had no activity for ${days} days. Please update it, reply to keep it open, or close it if it is no longer needed. Add the \`${EXEMPT_LABEL}\` label, or ask a maintainer to add it, to stop these reminders.`,
|
||||
].join('\n')
|
||||
}
|
||||
|
||||
/**
|
||||
* Posts every due reminder on open pull requests of the workflow repository.
|
||||
* @param {object} options
|
||||
* @param {object} options.github Authenticated Octokit client from `actions/github-script`.
|
||||
* @param {object} options.context Workflow context from `actions/github-script`.
|
||||
* @param {object} options.core Actions toolkit core from `actions/github-script`.
|
||||
* @param {Date} [options.now] Evaluation time.
|
||||
* @param {(ms: number) => Promise<void>} [options.sleep] Delay between comments.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export async function remindStalePullRequests({ github, context, core, now = new Date(), sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) }) {
|
||||
const { owner, repo } = context.repo
|
||||
const pulls = await github.paginate(github.rest.pulls.list, { owner, repo, state: 'open', sort: 'updated', direction: 'asc', per_page: 100 })
|
||||
let posted = 0
|
||||
let failed = 0
|
||||
for (const pull of pulls) {
|
||||
if (posted >= MAX_COMMENTS_PER_RUN) break
|
||||
if (isBot(pull.user)) continue
|
||||
if (pull.labels.some(label => label.name === EXEMPT_LABEL)) continue
|
||||
try {
|
||||
const timeline = await github.paginate(github.rest.issues.listEventsForTimeline, { owner, repo, issue_number: pull.number, per_page: 100 })
|
||||
const days = dueReminder({ createdAt: pull.created_at, timeline, now })
|
||||
if (days === undefined) continue
|
||||
if (posted > 0) await sleep(COMMENT_INTERVAL_MS)
|
||||
await github.rest.issues.createComment({ owner, repo, issue_number: pull.number, body: reminderBody(pull.user.login, days) })
|
||||
posted++
|
||||
core.info(`#${pull.number}: posted the ${days}-day reminder`)
|
||||
} catch (error) {
|
||||
failed++
|
||||
core.warning(`#${pull.number}: ${error.message}`)
|
||||
}
|
||||
}
|
||||
if (failed > 0) core.setFailed(`${failed} pull requests failed; see the warnings above.`)
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
|
||||
import { dueReminder, reminderBody, remindStalePullRequests } from './remind.mjs'
|
||||
|
||||
const now = new Date('2026-11-30T00:00:00Z')
|
||||
const daysAgo = days => new Date(now.getTime() - days * 24 * 60 * 60 * 1000).toISOString()
|
||||
const human = { login: 'author', type: 'User' }
|
||||
const bot = { login: 'github-actions[bot]', type: 'Bot' }
|
||||
const comment = (actor, days, body = 'ok') => ({ event: 'commented', actor, created_at: daysAgo(days), body })
|
||||
const reminder = (days, stage) => comment(bot, days, reminderBody('author', stage))
|
||||
|
||||
test('no reminder is due within 7 days of the last activity', () => {
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(6), timeline: [], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(30), timeline: [comment(human, 6)], now }), undefined)
|
||||
})
|
||||
|
||||
test('the latest due stage is posted once after the last activity', () => {
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(7), timeline: [], now }), 7)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(10), timeline: [reminder(3, 7)], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(14), timeline: [reminder(7, 7)], now }), 14)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [], now }), 14)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [reminder(20, 14)], now }), undefined)
|
||||
})
|
||||
|
||||
test('human activity restarts the cycle and bot activity does not', () => {
|
||||
const sentBefore = [reminder(30, 7), reminder(23, 14)]
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, comment(human, 8)], now }), 7)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'committed', committer: { date: daysAgo(3) } }], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'reviewed', user: human, submitted_at: daysAgo(3) }], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'line-commented', comments: [{ user: human, created_at: daysAgo(3) }] }], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'head_ref_force_pushed', actor: human, created_at: daysAgo(3) }], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, comment({ login: 'ci[bot]', type: 'Bot' }, 1)], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, comment({ login: 'ds-review-bot', type: 'User' }, 1)], now }), undefined)
|
||||
})
|
||||
|
||||
test('mentions, labels and cross references are not activity', () => {
|
||||
const at = (event, days) => ({ event, actor: human, created_at: daysAgo(days) })
|
||||
// GitHub records a `mentioned` event for the author right after each reminder.
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(14), timeline: [reminder(7, 7), at('mentioned', 7 - 1e-5), at('subscribed', 7 - 1e-5)], now }), 14)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(20), timeline: [at('labeled', 1), at('cross-referenced', 1), at('review_requested', 1)], now }), 14)
|
||||
})
|
||||
|
||||
test('reminders mention the author and skip exempt and bot-authored pull requests', async () => {
|
||||
const pull = (number, overrides = {}) => ({ number, user: human, labels: [], created_at: daysAgo(20), updated_at: daysAgo(20), ...overrides })
|
||||
const pulls = [
|
||||
pull(1),
|
||||
pull(2, { labels: [{ name: 'DO_NOT_CLOSE' }] }),
|
||||
pull(3, { user: { login: 'dependabot[bot]', type: 'Bot' } }),
|
||||
// A bot comment or label refreshes `updated_at` without being activity.
|
||||
pull(4, { updated_at: daysAgo(1) }),
|
||||
pull(6),
|
||||
pull(5),
|
||||
]
|
||||
const comments = []
|
||||
const timelines = []
|
||||
const github = {
|
||||
rest: {
|
||||
pulls: { list: 'pulls' },
|
||||
issues: {
|
||||
listEventsForTimeline: 'timeline',
|
||||
createComment: async params => {
|
||||
if (params.issue_number === 6) throw new Error('locked')
|
||||
comments.push(params)
|
||||
},
|
||||
},
|
||||
},
|
||||
paginate: async (method, params) => {
|
||||
if (method === 'pulls') return pulls
|
||||
timelines.push(params.issue_number)
|
||||
return []
|
||||
},
|
||||
}
|
||||
const sleeps = []
|
||||
const warnings = []
|
||||
const failures = []
|
||||
const core = { info() {}, warning: message => warnings.push(message), setFailed: message => failures.push(message) }
|
||||
await remindStalePullRequests({ github, context: { repo: { owner: 'o', repo: 'r' } }, core, now, sleep: async ms => sleeps.push(ms) })
|
||||
assert.deepEqual(timelines, [1, 4, 6, 5])
|
||||
assert.deepEqual(warnings, ['#6: locked'])
|
||||
assert.equal(failures.length, 1)
|
||||
assert.deepEqual(comments.map(({ issue_number }) => issue_number), [1, 4, 5])
|
||||
assert.match(comments[0].body, /^<!-- stale-pr-reminder:14 -->\n@author This pull request has had no activity for 14 days\./)
|
||||
assert.deepEqual(sleeps, [1000, 1000, 1000])
|
||||
})
|
||||
|
||||
test('a run posts at most 100 reminders', async () => {
|
||||
const pulls = Array.from({ length: 105 }, (_, number) => ({ number, user: human, labels: [], created_at: daysAgo(20), updated_at: daysAgo(20) }))
|
||||
let comments = 0
|
||||
const github = {
|
||||
rest: { pulls: { list: 'pulls' }, issues: { listEventsForTimeline: 'timeline', createComment: async () => comments++ } },
|
||||
paginate: async method => method === 'pulls' ? pulls : [],
|
||||
}
|
||||
await remindStalePullRequests({ github, context: { repo: { owner: 'o', repo: 'r' } }, core: { info() {} }, now, sleep: async () => {} })
|
||||
assert.equal(comments, 100)
|
||||
})
|
||||
@@ -0,0 +1,35 @@
|
||||
# Reminds authors of open pull requests after 7 and 14 days without activity; never closes them.
|
||||
# Rules: .github/stale-pull-requests/remind.mjs.
|
||||
name: Stale pull requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 2 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: stale-pull-requests
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
remind:
|
||||
name: Remind stale pull requests
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Check out reminder rules
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
with:
|
||||
sparse-checkout: .github/stale-pull-requests
|
||||
persist-credentials: false
|
||||
- name: Post due reminders
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
|
||||
with:
|
||||
script: |
|
||||
const { remindStalePullRequests } = await import(`${process.env.GITHUB_WORKSPACE}/.github/stale-pull-requests/remind.mjs`)
|
||||
await remindStalePullRequests({ github, context, core })
|
||||
@@ -17,13 +17,25 @@ const SESSION_ACTION_EXPECTED = join(EXPECTED, 'session-actions.expected.md')
|
||||
const SESSION_SEED = fileURLToPath(new URL('../../../snapshots/web/seeded-history/session.v3.jsonl', import.meta.url))
|
||||
const SESSION_TITLE = 'Session action extension'
|
||||
|
||||
async function openInventory(page: Page, url: string) {
|
||||
/** Load the page on the Plugins page, which reports this page's client synchronization. */
|
||||
async function openPlugins(page: Page, url: string) {
|
||||
await page.goto(url, { waitUntil: 'load' })
|
||||
await page.getByRole('navigation', { name: '全局面板' }).getByRole('button', { name: '插件', exact: true }).click()
|
||||
await page.locator('[data-plugin-body]').waitFor({ timeout: 10_000 })
|
||||
}
|
||||
|
||||
/** Open the Models settings page's add-provider card and return its API key field, a page-local draft. */
|
||||
async function openDraft(page: Page) {
|
||||
await openSettings(page, 'zh')
|
||||
const dialog = page.getByRole('dialog', { name: '设置' })
|
||||
await dialog.getByRole('button', { name: '内置插件', exact: true }).click()
|
||||
await dialog.getByRole('searchbox', { name: '搜索插件' }).waitFor()
|
||||
return dialog
|
||||
await dialog.getByRole('button', { name: '模型', exact: true }).click()
|
||||
const add = dialog.getByRole('button', { name: '添加模型提供商', exact: true })
|
||||
await expect.poll(() => add.isEnabled(), { timeout: 10_000 }).toBe(true)
|
||||
await add.click()
|
||||
await dialog.getByLabel('提供商', { exact: true }).selectOption('minimax-cn')
|
||||
const draft = dialog.getByRole('textbox', { name: 'API 密钥', exact: true })
|
||||
await draft.waitFor({ timeout: 10_000 })
|
||||
return draft
|
||||
}
|
||||
|
||||
it('keeps ordered legacy Session menu rows before Archive and removes them with their fiber', async () => {
|
||||
@@ -237,8 +249,9 @@ it('synchronizes two pages, disposes effects and restores an offline page from t
|
||||
const other = await otherContext.newPage()
|
||||
const consoles = [watchConsole(page), watchConsole(other)]
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-client-live'))
|
||||
await openInventory(page, scaffold.authenticatedUrl)
|
||||
const otherInventory = await openInventory(other, scaffold.authenticatedUrl)
|
||||
await openPlugins(page, scaffold.authenticatedUrl)
|
||||
await openPlugins(other, scaffold.authenticatedUrl)
|
||||
const draft = await openDraft(other)
|
||||
let entryId: string | undefined
|
||||
const toggle = async () => {
|
||||
if (entryId === undefined) entryId = await scaffold.ctx.loader.create({ name: '@fixture/live-client' })
|
||||
@@ -265,9 +278,8 @@ it('synchronizes two pages, disposes effects and restores an offline page from t
|
||||
}
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'enabled.expected.md'), await captureStableAria(page, '[data-live-client]', scaffold.workspaceCwd), webSnapshotMode())
|
||||
|
||||
// The inventory filter is page-owned state that live composition must preserve.
|
||||
const draft = otherInventory.getByRole('searchbox', { name: '搜索插件' })
|
||||
await draft.fill('unfinished-filter')
|
||||
// An unsaved Settings field is page-owned state that live composition must preserve.
|
||||
await draft.fill('unfinished-draft')
|
||||
await toggle()
|
||||
for (const target of [page, other]) {
|
||||
await expect.poll(() => live(target).count()).toBe(0)
|
||||
@@ -276,7 +288,7 @@ it('synchronizes two pages, disposes effects and restores an offline page from t
|
||||
expect((await dataset(target)).liveHits).toBe('1')
|
||||
expect(await target.locator('style[data-plugin="@fixture/live-client"]').count()).toBe(0)
|
||||
}
|
||||
expect(await draft.inputValue()).toBe('unfinished-filter')
|
||||
expect(await draft.inputValue()).toBe('unfinished-draft')
|
||||
await toggle()
|
||||
for (const target of [page, other]) {
|
||||
await live(target).waitFor()
|
||||
@@ -299,7 +311,7 @@ it('synchronizes two pages, disposes effects and restores an offline page from t
|
||||
expect(await live(other).count()).toBe(1)
|
||||
await otherContext.setOffline(false)
|
||||
await expect.poll(() => live(other).count(), { timeout: 20_000 }).toBe(0)
|
||||
expect(await draft.inputValue()).toBe('unfinished-filter')
|
||||
expect(await draft.inputValue()).toBe('unfinished-draft')
|
||||
expect(navigations).toBe(0)
|
||||
expect(scaffold.ctx.loader.ctx.fiber.uid).toBe(host)
|
||||
for (const console of consoles) expect(console.pageErrors).toEqual([])
|
||||
@@ -315,7 +327,7 @@ it('keeps a failed client download local and retries without changing Host enabl
|
||||
try {
|
||||
const page = await browser.newPage({ locale: ZH_BROWSER_LOCALE })
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-client-live-retry'))
|
||||
await openInventory(page, scaffold.authenticatedUrl)
|
||||
await openPlugins(page, scaffold.authenticatedUrl)
|
||||
const bundle = (url: URL) => url.pathname.startsWith('/plugins/') && url.search.includes('@fixture/live-client/client.js')
|
||||
await page.route(bundle, route => route.abort())
|
||||
const entryId = await scaffold.ctx.loader.create({ name: '@fixture/live-client' })
|
||||
@@ -352,9 +364,9 @@ it('recovers an uncreated client entry with rebuilt factory code without navigat
|
||||
try {
|
||||
const page = await browser.newPage({ locale: ZH_BROWSER_LOCALE })
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-client-factory-rebuild'))
|
||||
const inventory = await openInventory(page, scaffold.authenticatedUrl)
|
||||
const draft = inventory.getByRole('searchbox', { name: '搜索插件' })
|
||||
await draft.fill('unfinished-filter')
|
||||
await openPlugins(page, scaffold.authenticatedUrl)
|
||||
const draft = await openDraft(page)
|
||||
await draft.fill('unfinished-draft')
|
||||
let navigations = 0
|
||||
page.on('framenavigated', () => { navigations++ })
|
||||
const entryId = await scaffold.ctx.loader.create({ name: '@fixture/live-client' })
|
||||
@@ -366,7 +378,7 @@ it('recovers an uncreated client entry with rebuilt factory code without navigat
|
||||
await page.getByText('动态插件 r1 已启用', { exact: true }).waitFor()
|
||||
await expect.poll(() => failure.count()).toBe(0)
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'recovered.expected.md'), await captureStableAria(page, '[data-live-client]', scaffold.workspaceCwd), webSnapshotMode())
|
||||
expect(await draft.inputValue()).toBe('unfinished-filter')
|
||||
expect(await draft.inputValue()).toBe('unfinished-draft')
|
||||
expect(await page.locator('style[data-plugin="@fixture/live-client"]').count()).toBe(1)
|
||||
expect(await page.evaluate(() => document.documentElement.dataset.liveMounts)).toBe('1')
|
||||
expect(scaffold.ctx.loader.resolve(entryId).fiber?.state).toBe(2)
|
||||
@@ -386,9 +398,9 @@ it('reports bootstrap rebuilds without remounting the settings page or navigatin
|
||||
const page = await browser.newPage({ locale: ZH_BROWSER_LOCALE })
|
||||
const console = watchConsole(page)
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-client-bootstrap-rebuild'))
|
||||
const inventory = await openInventory(page, scaffold.authenticatedUrl)
|
||||
const draft = inventory.getByRole('searchbox', { name: '搜索插件' })
|
||||
await draft.fill('unfinished-filter')
|
||||
await openPlugins(page, scaffold.authenticatedUrl)
|
||||
const draft = await openDraft(page)
|
||||
await draft.fill('unfinished-draft')
|
||||
const originalInput = await draft.elementHandle()
|
||||
let navigations = 0
|
||||
page.on('framenavigated', () => { navigations++ })
|
||||
@@ -399,11 +411,12 @@ it('reports bootstrap rebuilds without remounting the settings page or navigatin
|
||||
scaffold.ctx.clientModules.rebuilt('@deepseek-ai/dsh-client-modules')
|
||||
const failure = page.locator('[data-client-sync-failure]')
|
||||
await failure.getByText(/replacing bootstrap module .* requires a page reload/).waitFor()
|
||||
await failure.getByRole('button', { name: '重试本页面同步' }).click()
|
||||
// The Settings dialog holding the draft covers the Plugins page, so the retry is dispatched to its button.
|
||||
await failure.getByRole('button', { name: '重试本页面同步' }).dispatchEvent('click')
|
||||
await failure.getByText(/replacing bootstrap module .* requires a page reload/).waitFor()
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'bootstrap-rebuild.expected.md'), await captureStableAria(page, '[data-client-sync-failure]', scaffold.workspaceCwd), webSnapshotMode())
|
||||
expect(await originalInput!.evaluate(input => input.isConnected)).toBe(true)
|
||||
expect(await draft.inputValue()).toBe('unfinished-filter')
|
||||
expect(await draft.inputValue()).toBe('unfinished-draft')
|
||||
expect(scaffold.ctx.loader.ctx.fiber.uid).toBe(host)
|
||||
expect(navigations).toBe(0)
|
||||
expect(console.pageErrors).toEqual([])
|
||||
@@ -421,7 +434,7 @@ it('removes the client UI and resources while Host cleanup is still pending', as
|
||||
const browser = await chromium.launch()
|
||||
try {
|
||||
const page = await browser.newPage({ locale: ZH_BROWSER_LOCALE })
|
||||
await openInventory(page, scaffold.authenticatedUrl)
|
||||
await openPlugins(page, scaffold.authenticatedUrl)
|
||||
let navigations = 0
|
||||
page.on('framenavigated', () => { navigations++ })
|
||||
const entryId = await scaffold.ctx.loader.create({ name: '@fixture/live-client' })
|
||||
|
||||
@@ -112,7 +112,8 @@ it.skipIf(process.platform !== 'darwin').each([
|
||||
expect(await card.getByText('实验性', { exact: true }).count()).toBe(1)
|
||||
expect(await card.textContent()).not.toContain('将 PTC 模式改为可持久化')
|
||||
expect(await card.textContent()).not.toContain('请切换到 PTC 模式')
|
||||
expect(await card.textContent()).toContain('通过 npm 安装 DSH 的 Windows 用户需要单独配置 helper')
|
||||
expect(await card.textContent()).toContain('允许 agent 直接操作电脑上的应用程序。')
|
||||
expect(await card.textContent()).not.toContain('helper')
|
||||
expect(await card.textContent()).not.toContain('Swift')
|
||||
const description = await card.getByRole('button', { name: '查看 Computer Use', exact: true }).evaluate((button) => {
|
||||
const element = document.getElementById(button.getAttribute('aria-describedby')!)!
|
||||
@@ -175,7 +176,12 @@ it.skipIf(process.platform !== 'darwin').each([
|
||||
expect(scaffold.ctx.agentPresets.composedPreset(fresh.ctx)).toBe('ptc')
|
||||
expect(scaffold.ctx.tools.schemas(fresh).some(tool => tool.name === 'cua')).toBe(true)
|
||||
await card.getByRole('button', { name: '查看 Computer Use', exact: true }).click()
|
||||
await plugins.locator('[data-detail-document]').getByText('helperPath', { exact: true }).waitFor()
|
||||
const detail = plugins.locator('[data-detail-document]')
|
||||
await detail.getByRole('img', { name: '将会议要点填入备忘录的指令和输入结果' }).waitFor()
|
||||
const guidance = plugins.locator('[data-cua-guidance]')
|
||||
await guidance.getByText(/请谨慎在生产环境中使用/).waitFor()
|
||||
expect(await guidance.textContent()).not.toContain('helperPath')
|
||||
expect(await detail.textContent()).not.toContain('PTC')
|
||||
toggle = page.locator('[data-plugin-panel]').getByRole('switch', { name: '启用 Computer Use', exact: true })
|
||||
const persistent = page.getByRole('group', { name: 'PTC 执行方式', exact: true })
|
||||
if (!codingTools) {
|
||||
|
||||
@@ -333,3 +333,41 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr
|
||||
await diagnostic.waitFor({ state: 'hidden' })
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
})
|
||||
|
||||
it.skipIf(process.platform !== 'darwin' && process.platform !== 'win32')('shows Windows setup when the helper is missing', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'dsh-cua-missing-helper-'))
|
||||
const resources: { scaffold?: WebScaffold; browser?: Browser } = {}
|
||||
onTestFinished(async () => {
|
||||
try { await resources.browser?.close() } finally {
|
||||
try { await resources.scaffold?.close() } finally { await rm(root, { recursive: true, force: true }) }
|
||||
}
|
||||
})
|
||||
const patch = join(root, 'missing-helper.yml')
|
||||
const row = process.platform === 'win32' ? 'cua-windows' : 'cua-macos'
|
||||
await writeFile(patch, JSON.stringify([{ id: row, config: { helperPath: join(root, 'missing.exe') } }]))
|
||||
const scaffold = resources.scaffold = await launchWebScaffold({
|
||||
profile: { packages: [{ dir: bundle, enabled: true }] }, extraOverlayPath: patch,
|
||||
})
|
||||
if (process.platform === 'darwin') {
|
||||
// The Host inventory reads this Loader flag; only the platform-specific input is substituted on macOS.
|
||||
const windows = [...scaffold.ctx.loader.entries()].find(entry => entry.options.id === 'cua-windows')
|
||||
if (!windows) throw new Error('CUA bundle has no Windows provider row')
|
||||
vi.spyOn(windows, 'disabled', 'get').mockReturnValue(false)
|
||||
}
|
||||
const browser = resources.browser = await chromium.launch()
|
||||
const page = await newEnglishPage(browser)
|
||||
await page.goto(scaffold.authenticatedUrl)
|
||||
await page.getByRole('button', { name: 'Plugins', exact: true }).click()
|
||||
await page.getByRole('button', { name: 'View Computer use', exact: true }).click()
|
||||
const panel = page.locator('[data-cua-settings]')
|
||||
const guidance = panel.locator('[data-cua-guidance]')
|
||||
await guidance.getByText(/pnpm run build:native:x64/).waitFor()
|
||||
await guidance.getByText(/helperPath/).waitFor()
|
||||
const preview = page.locator('[data-detail-document] img')
|
||||
await preview.evaluate(async (image) => { await (image as HTMLImageElement).decode() })
|
||||
const firstSetting = panel.getByRole('group', { name: 'Default mode for new sessions', exact: true })
|
||||
const previewBox = await preview.boundingBox(), guidanceBox = await guidance.boundingBox(), settingBox = await firstSetting.boundingBox()
|
||||
expect(previewBox!.y + previewBox!.height).toBeLessThanOrEqual(guidanceBox!.y)
|
||||
expect(guidanceBox!.y + guidanceBox!.height).toBeLessThanOrEqual(settingBox!.y)
|
||||
expect(await panel.getByRole('button', { name: 'Request permission', exact: true }).count()).toBe(0)
|
||||
})
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
- region "Authorize computer use":
|
||||
- paragraph: Computer use is an experimental preview. The agent may click the wrong button or type in the wrong window. Use caution in production environments. We recommend native PTC mode so the agent can operate apps and call other tools in the same program.
|
||||
- heading "Authorize computer use" [level=3]
|
||||
- group "Default mode for new sessions":
|
||||
- strong: Default mode for new sessions
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "General"
|
||||
- button "Models"
|
||||
- button "Built-in plugins"
|
||||
- button "Plugins"
|
||||
- button "Agent presets"
|
||||
- button "Open configuration file"
|
||||
- button "Close"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Touch refresh: one refresh request; no tooltip
|
||||
Touch explanation: visible within the 390px viewport
|
||||
- tooltip "在这里配置官方插件,安装和管理其他插件。内置插件列表及运行状态可在「设置 → 内置插件」中查看"
|
||||
- tooltip "在这里配置官方插件,安装、管理和配置其他插件。"
|
||||
Explanation closes on another tap or an outside touch
|
||||
Keyboard focus after touch: refresh tooltip visible
|
||||
Mouse hover after touch: refresh tooltip visible
|
||||
@@ -5,4 +5,6 @@
|
||||
- 768px: single row; index, search, labels, sort, and refresh are contained, reachable, and separate; no horizontal overflow; search focus retained.
|
||||
- 1280px: single row; index, search, labels, sort, and refresh are contained, reachable, and separate; no horizontal overflow; search focus retained.
|
||||
|
||||
The source dialog treats a Raw URL and an unmarked custom URL as JSON. It shows Git fields for an SSH clone address or a git+https URL. The fields fit and stay reachable at 390px and 1280px. Editing the address preserves the Git draft, and Escape closes the dialog.
|
||||
|
||||
At 390px, restoring the previous no-wrap layout causes horizontal overflow and fails the same layout check. Removing that override restores the controls and preserves search focus.
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "General"
|
||||
- button "Models"
|
||||
- button "Built-in plugins"
|
||||
- button "Plugins"
|
||||
- button "Agent presets"
|
||||
- button "Open configuration file"
|
||||
- button "Close"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "General"
|
||||
- button "Models"
|
||||
- button "Built-in plugins"
|
||||
- button "Plugins"
|
||||
- button "Agent presets"
|
||||
- button "Open configuration file"
|
||||
- button "Close"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- navigation:
|
||||
- button "通用设置"
|
||||
- button "模型"
|
||||
- button "内置插件"
|
||||
- button "插件管理"
|
||||
- button "Agent 预设"
|
||||
- button "打开配置文件"
|
||||
- button "关闭"
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
- list:
|
||||
- listitem:
|
||||
- button "子智能体控制工具, tool-subagent-control, 已启用":
|
||||
- strong: 子智能体控制工具
|
||||
- text: 让 AI 向子智能体发送消息或中断其运行。
|
||||
- code: tool-subagent-control
|
||||
- listitem:
|
||||
- button "子智能体委派工具, tool-subagent, 已启用":
|
||||
- strong: 子智能体委派工具
|
||||
- text: 让 AI 将任务交给子智能体,并获取运行结果。
|
||||
- code: tool-subagent
|
||||
- listitem:
|
||||
- button "子智能体委派工具, tool-subagent-fork, 已启用":
|
||||
- strong: 子智能体委派工具
|
||||
- text: 让 AI 将任务交给子智能体,并获取运行结果。
|
||||
- code: tool-subagent-fork
|
||||
@@ -1,5 +0,0 @@
|
||||
- listitem:
|
||||
- button "子智能体委派工具, tool-subagent, 已启用":
|
||||
- strong: 子智能体委派工具
|
||||
- text: 让 AI 将任务交给子智能体,并获取运行结果。
|
||||
- code: tool-subagent
|
||||
@@ -0,0 +1,16 @@
|
||||
/** Test package registering its own settings page into `settings.section`. */
|
||||
window.__ModuleLoader__.load({
|
||||
id: '@fixture/settings-section',
|
||||
factory(require) {
|
||||
const React = require('react')
|
||||
return {
|
||||
inject: ['slots'],
|
||||
apply(ctx) {
|
||||
ctx.slots.inject('settings.section', () => ctx.slots.register({
|
||||
name: 'settings.section', id: 'fixture-settings-section', label: 'Fixture settings',
|
||||
}, () => React.createElement('section', { 'data-fixture-settings-section': '', 'aria-label': 'Fixture settings' },
|
||||
React.createElement('p', null, 'Settings content from the fixture'))))
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
# Web e2e fixture bundle whose browser half registers a plugin settings page.
|
||||
- insert:
|
||||
- id: fixture-settings-section
|
||||
name: '@fixture/settings-section'
|
||||
@@ -0,0 +1,2 @@
|
||||
/** Host companion for the plugin settings page fixture. */
|
||||
export function apply() {}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "@fixture/settings-section",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"exports": { ".": "./index.js", "./client": "./client.js" },
|
||||
"dsh": {
|
||||
"bundle": { "patch": "./cordis.patch.yml" },
|
||||
"client": { "platform": "web" }
|
||||
}
|
||||
}
|
||||
@@ -10,13 +10,13 @@ import { fileURLToPath } from 'node:url'
|
||||
import type { Browser, Locator, Page } from 'playwright'
|
||||
import { chromium } from 'playwright'
|
||||
import { HIDDEN_BUNDLES } from '@deepseek-ai/dsh-official-bundles'
|
||||
import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest'
|
||||
import { afterAll, beforeAll, describe, expect, it, onTestFailed, onTestFinished } from 'vitest'
|
||||
import { join } from 'node:path'
|
||||
import {
|
||||
assertFixtureInventory, captureStableAria, compareOrRefreshGolden,
|
||||
launchWebScaffold, watchConsole, webSnapshotMode, type WebScaffold,
|
||||
} from './scaffold.ts'
|
||||
import { ZH_BROWSER_LOCALE, saveFailureShot } from './support.ts'
|
||||
import { ZH_BROWSER_LOCALE, openSettings, saveFailureShot } from './support.ts'
|
||||
|
||||
const SNAPSHOT_DIR = fileURLToPath(new URL('./expected/plugin-config', import.meta.url))
|
||||
const OFFICIAL_EXPECTED = join(SNAPSHOT_DIR, 'official.expected.md')
|
||||
@@ -503,6 +503,46 @@ describe('web e2e: plugin configuration pages', () => {
|
||||
expect(tripwire.warnings).toEqual([])
|
||||
await assertFixtureInventory(SNAPSHOT_DIR, ['bundle.expected.md', 'official.expected.md', 'row.expected.md', 'subagent.expected.md', 'web-search.expected.md'])
|
||||
})
|
||||
})
|
||||
|
||||
describe('web e2e: a community plugin settings page', () => {
|
||||
it('shows a settings.section entry in Settings and on its bundle row', async () => {
|
||||
const scaffold = await launchWebScaffold({
|
||||
profile: { packages: [{ dir: join(FIXTURE_PLUGINS, 'fixture-settings-section') }] },
|
||||
})
|
||||
onTestFinished(() => scaffold.close())
|
||||
const browser = await chromium.launch()
|
||||
onTestFinished(() => browser.close())
|
||||
const page = await browser.newPage({ viewport: { width: 1680, height: 1000 }, locale: ZH_BROWSER_LOCALE })
|
||||
const console = watchConsole(page)
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-plugin-config-settings-section'))
|
||||
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
|
||||
await page.getByRole('navigation', { name: '全局面板' }).getByRole('button', { name: '插件', exact: true }).click()
|
||||
const panel = page.locator('[data-plugin-panel]')
|
||||
await panel.getByRole('button', { name: '查看 @fixture/settings-section', exact: true }).click({ timeout: 20_000 })
|
||||
const row = panel.locator('[data-plugin-row]', { hasText: 'fixture-settings-section' })
|
||||
await row.waitFor({ timeout: 10_000 })
|
||||
const configure = panel.getByRole('button', { name: '配置 @fixture/settings-section' })
|
||||
expect(await configure.count()).toBe(0)
|
||||
|
||||
// Switched on, the browser half mounts and its settings page claims the row.
|
||||
await panel.getByRole('switch', { name: '启用 @fixture/settings-section' }).click()
|
||||
await configure.waitFor({ timeout: 30_000 })
|
||||
await configure.click()
|
||||
const rowPage = panel.locator('[data-plugin-row-detail="@fixture/settings-section#fixture-settings-section"]')
|
||||
await rowPage.waitFor({ timeout: 10_000 })
|
||||
await rowPage.getByRole('region', { name: 'Fixture settings', exact: true })
|
||||
.getByText('Settings content from the fixture', { exact: true }).waitFor({ timeout: 10_000 })
|
||||
|
||||
// Settings keeps the same page in its navigation.
|
||||
await openSettings(page, 'zh')
|
||||
const dialog = page.getByRole('dialog', { name: '设置', exact: true })
|
||||
await dialog.getByRole('navigation').getByRole('button', { name: 'Fixture settings', exact: true }).click()
|
||||
await dialog.getByRole('region', { name: 'Fixture settings', exact: true })
|
||||
.getByText('Settings content from the fixture', { exact: true }).waitFor({ timeout: 10_000 })
|
||||
await page.keyboard.press('Escape')
|
||||
await expect.poll(() => dialog.count(), { timeout: 5_000 }).toBe(0)
|
||||
expect(console.pageErrors).toEqual([])
|
||||
expect(console.warnings).toEqual([])
|
||||
}, 90_000)
|
||||
})
|
||||
@@ -792,14 +792,14 @@ describe('web e2e: plugin manager', () => {
|
||||
await info.hover()
|
||||
const hoverHelp = page.getByRole('tooltip')
|
||||
await hoverHelp.waitFor()
|
||||
expect(await hoverHelp.textContent()).toBe('在这里配置官方插件,安装和管理其他插件。内置插件列表及运行状态可在「设置 → 内置插件」中查看')
|
||||
expect(await hoverHelp.textContent()).toBe('在这里配置官方插件,安装、管理和配置其他插件。')
|
||||
await panel.getByRole('heading', { name: '插件', exact: true }).hover()
|
||||
await hoverHelp.waitFor({ state: 'hidden' })
|
||||
await info.focus()
|
||||
await page.keyboard.press('Enter')
|
||||
const help = page.getByRole('tooltip')
|
||||
await help.waitFor()
|
||||
expect(await help.textContent()).toContain('设置 → 内置插件')
|
||||
expect(await help.textContent()).toBe('在这里配置官方插件,安装、管理和配置其他插件。')
|
||||
await page.keyboard.press('Escape')
|
||||
expect(await help.count()).toBe(0)
|
||||
expect(await info.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/** Keyless browser geometry for the Discover toolbar against a local plugin index. */
|
||||
/** Keyless browser checks for Discover against a local plugin index. */
|
||||
import { once } from 'node:events'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { createServer } from 'node:http'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { chromium, type Locator } from 'playwright'
|
||||
import { chromium, type Locator, type Page } from 'playwright'
|
||||
import { expect, it } from 'vitest'
|
||||
import type {} from '@deepseek-ai/dsh-plugin-market'
|
||||
import { compareOrRefreshGolden, launchWebScaffold, watchConsole, webSnapshotMode } from './scaffold.ts'
|
||||
@@ -53,6 +53,49 @@ function validLayout(layout: Awaited<ReturnType<typeof measure>>): boolean {
|
||||
&& !layout.overflow && !layout.pageOverflow && layout.focused
|
||||
}
|
||||
|
||||
async function checkSourceForm(page: Page, toolbar: Locator): Promise<void> {
|
||||
await toolbar.getByRole('button', { name: /^切换插件索引/u }).click()
|
||||
await page.getByRole('menuitem', { name: '管理索引源…', exact: true }).click()
|
||||
const dialog = page.getByRole('dialog', { name: '索引源', exact: true })
|
||||
const address = dialog.getByRole('textbox', { name: '源地址', exact: true })
|
||||
const path = dialog.getByRole('textbox', { name: '索引文件路径', exact: true })
|
||||
const ref = dialog.getByRole('textbox', { name: 'Git 引用', exact: true })
|
||||
const add = dialog.getByRole('button', { name: '添加', exact: true })
|
||||
await expect.poll(() => address.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
expect(await dialog.getByRole('combobox').count()).toBe(0)
|
||||
|
||||
await address.fill('https://git.example/acme/plugins')
|
||||
expect(await add.isEnabled()).toBe(true)
|
||||
expect(await path.count()).toBe(0)
|
||||
await address.fill('https://raw.githubusercontent.com/acme/plugins/main/index.json')
|
||||
expect(await add.isEnabled()).toBe(true)
|
||||
expect(await path.count()).toBe(0)
|
||||
await address.fill('[email protected]:acme/plugins.git')
|
||||
expect(await address.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
await path.fill('distribution/market/catalogs/team-index.json')
|
||||
await ref.fill('release/plugins')
|
||||
for (const width of [390, 1280]) {
|
||||
await page.setViewportSize({ width, height: 844 })
|
||||
await expect.poll(() => dialog.locator('form').evaluate((form) => {
|
||||
const bounds = form.getBoundingClientRect()
|
||||
return Array.from(form.querySelectorAll('input, button')).every((control) => {
|
||||
const rect = control.getBoundingClientRect()
|
||||
const hit = document.elementFromPoint(rect.left + rect.width / 2, rect.top + rect.height / 2)
|
||||
return rect.left >= bounds.left && rect.right <= bounds.right && rect.left >= 0 && rect.right <= innerWidth
|
||||
&& hit !== null && control.contains(hit)
|
||||
})
|
||||
})).toBe(true)
|
||||
expect(await ref.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
}
|
||||
await address.fill('https://git.example/acme/plugins')
|
||||
expect(await path.count()).toBe(0)
|
||||
await address.fill('git+https://git.example/acme/plugins')
|
||||
expect(await path.inputValue()).toBe('distribution/market/catalogs/team-index.json')
|
||||
expect(await ref.inputValue()).toBe('release/plugins')
|
||||
await page.keyboard.press('Escape')
|
||||
await dialog.waitFor({ state: 'hidden' })
|
||||
}
|
||||
|
||||
it('keeps Discover controls reachable when the toolbar wraps and retains search focus across widths', async () => {
|
||||
const body = await readFile(INDEX)
|
||||
const source = createServer((request, response) => {
|
||||
@@ -113,7 +156,9 @@ it('keeps Discover controls reachable when the toolbar wraps and retains search
|
||||
}, previous)
|
||||
}
|
||||
await expect.poll(async () => validLayout(await measure(toolbar))).toBe(true)
|
||||
await checkSourceForm(page, toolbar)
|
||||
expect(consoleWatch.pageErrors).toEqual([])
|
||||
facts.push('', 'The source dialog treats a Raw URL and an unmarked custom URL as JSON. It shows Git fields for an SSH clone address or a git+https URL. The fields fit and stay reachable at 390px and 1280px. Editing the address preserves the Git draft, and Escape closes the dialog.')
|
||||
await compareOrRefreshGolden(EXPECTED,
|
||||
`# Discover toolbar responsive layout\n\n${facts.join('\n')}\n\nAt 390px, restoring the previous no-wrap layout causes horizontal overflow and fails the same layout check. Removing that override restores the controls and preserves search focus.`,
|
||||
webSnapshotMode())
|
||||
|
||||
@@ -189,12 +189,6 @@ it('shares settings card materials and control sizes in both palettes', async ()
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'account.expected.md'),
|
||||
await captureStableAria(page, 'section[aria-label="账号与余额"]', scaffold.workspaceCwd), webSnapshotMode())
|
||||
|
||||
await dialog.getByRole('button', { name: '内置插件', exact: true }).click()
|
||||
await dialog.getByRole('button', { name: /^全局/ }).click()
|
||||
const plugin = dialog.locator('[data-plugin-scope="global"] [data-plugin-entry]').first()
|
||||
await plugin.waitFor()
|
||||
expect(await appearance(plugin)).toMatchObject(material)
|
||||
|
||||
await dialog.getByRole('button', { name: 'Agent 预设', exact: true }).click()
|
||||
const preset = dialog.locator('li').first()
|
||||
await preset.waitFor()
|
||||
|
||||
@@ -24,11 +24,8 @@ import { brandString } from '@deepseek-ai/dsh-brand'
|
||||
|
||||
const SNAPSHOT_DIR = fileURLToPath(new URL('./expected/settings-chrome', import.meta.url))
|
||||
const DIALOG_EXPECTED = join(SNAPSHOT_DIR, 'dialog.expected.md')
|
||||
const PLUGINS_EXPECTED = join(SNAPSHOT_DIR, 'plugins.expected.md')
|
||||
const PLUGIN_INSTANCES_EXPECTED = join(SNAPSHOT_DIR, 'plugin-instances.expected.md')
|
||||
// The English fallback surface: a browser naming no shipped language.
|
||||
const DIALOG_EN_EXPECTED = join(SNAPSHOT_DIR, 'dialog-en.expected.md')
|
||||
const PLUGIN_ROW_SELECTOR = '[data-plugin-scope="preset"] [data-plugin-entry="tool-subagent"]'
|
||||
const MODE = webSnapshotMode()
|
||||
const SCREENSHOTS = 'screenshots/collapse-timing-settings'
|
||||
const SCREENSHOT_DIR = fileURLToPath(new URL(`../../../.artifacts/${SCREENSHOTS}`, import.meta.url))
|
||||
@@ -140,84 +137,6 @@ describe('web e2e: settings modal and General preferences', () => {
|
||||
await dialog.getByRole('button', { name: '模型', exact: true }).click()
|
||||
await expect.poll(() => dialog.getByRole('button', { name: '模型', exact: true }).getAttribute('aria-current'), { timeout: 5_000 }).toBe('true')
|
||||
expect(await dialog.getByRole('button', { name: '通用设置' }).getAttribute('aria-current')).toBeNull()
|
||||
// Built-in plugins: the read-only Plugin list, a projection of the same
|
||||
// assembled Loader tree, shown as the section's one page; management and
|
||||
// configuration live on the sidebar's Plugins panel (its own scenario files
|
||||
// drive that page over a profile runtime). Capture one stable shipped row
|
||||
// rather than the whole inventory so adding an unrelated plugin does not
|
||||
// rewrite this surface's golden.
|
||||
await dialog.getByRole('button', { name: '内置插件', exact: true }).click()
|
||||
await dialog.getByRole('heading', { name: '内置插件', exact: true }).waitFor({ timeout: 10_000 })
|
||||
// The preset group starts open under its display-only switcher; the global group starts folded.
|
||||
const presetSwitcher = dialog.getByRole('button', { name: '选择要查看的 Agent 预设' })
|
||||
await presetSwitcher.waitFor({ timeout: 10_000 })
|
||||
// The shipped default's zh display name comes from the zh dictionaries.
|
||||
expect(await presetSwitcher.textContent()).toBe('标准模式(默认)')
|
||||
const presetToggle = dialog.getByRole('button', { name: '会话插件', exact: true })
|
||||
expect(await presetToggle.getAttribute('aria-expanded')).toBe('true')
|
||||
expect(await dialog.locator('[data-plugin-scope="preset"] [data-plugin-entry]').count()).toBeGreaterThan(0)
|
||||
const globalToggle = dialog.getByRole('button', { name: /^全局/ })
|
||||
expect(await globalToggle.getAttribute('aria-expanded')).toBe('false')
|
||||
await globalToggle.click()
|
||||
const pluginRow = dialog.locator(PLUGIN_ROW_SELECTOR)
|
||||
await pluginRow.waitFor({ timeout: 10_000 })
|
||||
const expectedPluginCount = [...scaffold.ctx.loader.entries()]
|
||||
.filter(entry => !entry.options.group)
|
||||
.length
|
||||
const pluginSearch = dialog.getByRole('searchbox', { name: '搜索插件' })
|
||||
expect(await pluginSearch.count()).toBe(1)
|
||||
// Every Loader entry appears exactly once in the global group — rows the
|
||||
// presets took over included, preset compositions excluded.
|
||||
expect(await dialog.locator('[data-plugin-scope="global"] [data-plugin-entry]').count())
|
||||
.toBe(expectedPluginCount)
|
||||
// A plainly enabled row states its status only in its accessible name: it
|
||||
// carries no tag, and an active fiber draws no dot, so no global row shows
|
||||
// either. Guard the assertions against matching nothing because no row is enabled.
|
||||
const enabledRows = dialog.locator('[data-plugin-scope="global"] [data-plugin-entry] button[aria-label$="已启用"]')
|
||||
expect(await enabledRows.count()).toBeGreaterThan(0)
|
||||
expect(await enabledRows.getByText('已启用', { exact: true }).count()).toBe(0)
|
||||
expect(await dialog.locator('[data-plugin-scope="global"] [role="img"][aria-label="运行中"]').count()).toBe(0)
|
||||
expect(await dialog.getByText('由 Agent 预设按会话组成', { exact: true }).count()).toBe(1)
|
||||
expect(await dialog.getByText('系统与所有会话共用', { exact: true }).count()).toBe(1)
|
||||
expect(await dialog.getByRole('button', { name: '内置插件', exact: true }).getAttribute('aria-current')).toBe('true')
|
||||
// One contribution shows as the page itself, without a tab row.
|
||||
expect(await dialog.getByRole('tab').count()).toBe(0)
|
||||
expect(await dialog.getByRole('button', { name: '模型', exact: true }).getAttribute('aria-current')).toBeNull()
|
||||
const pluginsSnapshot = await captureStableAria(
|
||||
page,
|
||||
PLUGIN_ROW_SELECTOR,
|
||||
scaffold.workspaceCwd,
|
||||
)
|
||||
await compareOrRefreshGolden(PLUGINS_EXPECTED, pluginsSnapshot, MODE)
|
||||
await pluginSearch.fill('tool-subagent')
|
||||
const instanceRows = [
|
||||
['tool-subagent', '已启用'],
|
||||
['tool-subagent-fork', '已启用'],
|
||||
] as const
|
||||
for (const [entryId, status] of instanceRows) {
|
||||
const row = dialog.locator(`[data-plugin-scope="preset"] [data-plugin-entry="${entryId}"]`)
|
||||
const name = `子智能体委派工具, ${entryId}, ${status}`
|
||||
const trigger = row.getByRole('button', { name, exact: true })
|
||||
await trigger.waitFor({ timeout: 10_000 })
|
||||
expect(await trigger.getAttribute('aria-expanded')).toBe('false')
|
||||
const identity = row.locator('code')
|
||||
expect(await identity.textContent()).toBe(entryId)
|
||||
expect(await identity.getAttribute('title')).toBe(entryId)
|
||||
}
|
||||
expect(await dialog.locator('[data-plugin-entry="tool-subagent-codex"], [data-plugin-entry="tool-subagent-claude-code"]').count()).toBe(0)
|
||||
const instancesSnapshot = await captureStableAria(
|
||||
page,
|
||||
'[data-plugin-scope="preset"] ul',
|
||||
scaffold.workspaceCwd,
|
||||
)
|
||||
await compareOrRefreshGolden(PLUGIN_INSTANCES_EXPECTED, instancesSnapshot, MODE)
|
||||
await dialog.getByRole('button', {
|
||||
name: '子智能体委派工具, tool-subagent-fork, 已启用',
|
||||
exact: true,
|
||||
}).click()
|
||||
expect(await dialog.locator('[data-plugin-entry="tool-subagent-fork"] button')
|
||||
.getAttribute('aria-expanded')).toBe('true')
|
||||
await pluginSearch.fill('')
|
||||
// Close path 1: Escape.
|
||||
await page.keyboard.press('Escape')
|
||||
await expect.poll(() => page.getByRole('dialog', { name: '设置' }).count(), { timeout: 5_000 }).toBe(0)
|
||||
@@ -229,6 +148,27 @@ describe('web e2e: settings modal and General preferences', () => {
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
}, 60_000)
|
||||
|
||||
it('leaves Settings for the sidebar Plugins page from the Plugin management entry', async () => {
|
||||
const linkPage = await browser.newPage({ viewport: { width: 1680, height: 1000 }, locale: ZH_BROWSER_LOCALE })
|
||||
onTestFinished(() => linkPage.close())
|
||||
onTestFailed(() => saveSettingsFailureShot(linkPage, 'settings-plugins-link'))
|
||||
const linkConsole = watchConsole(linkPage)
|
||||
await linkPage.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
|
||||
await openSettings(linkPage, 'zh')
|
||||
const dialog = linkPage.getByRole('dialog', { name: '设置', exact: true })
|
||||
const sections = await dialog.getByRole('navigation').getByRole('button').allTextContents()
|
||||
// The entry holds the position between Models and Agent presets.
|
||||
expect(sections.indexOf('插件管理')).toBe(sections.indexOf('模型') + 1)
|
||||
expect(sections.indexOf('Agent 预设')).toBe(sections.indexOf('插件管理') + 1)
|
||||
await dialog.getByRole('button', { name: '插件管理', exact: true }).click()
|
||||
await expect.poll(() => dialog.count(), { timeout: 5_000 }).toBe(0)
|
||||
const pluginsEntry = linkPage.getByRole('navigation', { name: '全局面板' }).getByRole('button', { name: '插件', exact: true })
|
||||
await expect.poll(() => pluginsEntry.getAttribute('aria-current'), { timeout: 10_000 }).toBe('page')
|
||||
await linkPage.locator('[data-plugin-panel]').getByRole('heading', { name: '插件', exact: true }).waitFor({ timeout: 10_000 })
|
||||
expect(linkConsole.pageErrors).toEqual([])
|
||||
expect(linkConsole.warnings).toEqual([])
|
||||
})
|
||||
|
||||
it('scrolls overflowing section navigation independently of the title and settings content', async () => {
|
||||
const overflowPage = await browser.newPage({ viewport: { width: 1280, height: 768 }, locale: ZH_BROWSER_LOCALE })
|
||||
onTestFinished(() => overflowPage.close())
|
||||
@@ -953,17 +893,12 @@ describe('web e2e: settings modal and General preferences', () => {
|
||||
const dialog = enPage.getByRole('dialog', { name: 'Settings' })
|
||||
await dialog.waitFor({ timeout: 10_000 })
|
||||
await dialog.getByRole('button', { name: 'English' }).waitFor({ timeout: 10_000 })
|
||||
// The plugin list resolves shipped preset names through the en
|
||||
// dictionaries instead of echoing the preset declarations' Chinese metadata.
|
||||
await dialog.getByRole('button', { name: 'Built-in plugins', exact: true }).click()
|
||||
const presetSwitcher = dialog.getByRole('button', { name: 'Choose the agent preset to inspect' })
|
||||
await presetSwitcher.waitFor({ timeout: 10_000 })
|
||||
expect(await presetSwitcher.textContent()).toBe('Standard mode (default)')
|
||||
// The plugin manager speaks the en dictionary too: its sidebar entry
|
||||
// and the unavailable notice a scaffold without a profile runtime shows.
|
||||
await enPage.keyboard.press('Escape')
|
||||
// The plugin manager speaks the en dictionary too: its Settings entry
|
||||
// leaves Settings for the Plugins page, whose header and the sidebar entry are English.
|
||||
await dialog.getByRole('button', { name: 'Plugins', exact: true }).click()
|
||||
await expect.poll(() => enPage.getByRole('dialog', { name: 'Settings' }).count(), { timeout: 5_000 }).toBe(0)
|
||||
await enPage.getByRole('navigation', { name: 'Global panels' }).getByRole('button', { name: 'Plugins', exact: true }).click()
|
||||
await expect.poll(() => enPage.getByRole('navigation', { name: 'Global panels' })
|
||||
.getByRole('button', { name: 'Plugins', exact: true }).getAttribute('aria-current'), { timeout: 10_000 }).toBe('page')
|
||||
await enPage.getByRole('button', { name: 'Add plugin', exact: true })
|
||||
.waitFor({ timeout: 10_000 })
|
||||
// This page has no closing inventory spec to sweep its console, so the
|
||||
@@ -1042,8 +977,6 @@ describe('web e2e: settings modal and General preferences', () => {
|
||||
'dialog.expected.md',
|
||||
'collapse-timing-en.expected.md',
|
||||
'collapse-timing-zh.expected.md',
|
||||
'plugin-instances.expected.md',
|
||||
'plugins.expected.md',
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
en: 41d772192075e133
|
||||
zh: 5ef3da69b4de1d8a
|
||||
/capability-seams-and-core-services:
|
||||
en: 377f8f047b34cfde
|
||||
zh: be08abadad0beb93
|
||||
en: 0ae3b368d7fcde08
|
||||
zh: 64c3cc22e17be96b
|
||||
@@ -29,7 +29,6 @@ flowchart LR
|
||||
svc_pluginRegistryProbe["ctx.pluginRegistryProbe<br/>Host registry response comparison"]
|
||||
pkg_plugin_manager["plugin-manager"]
|
||||
svc_pluginManager["ctx.pluginManager<br/>Current-profile plugin and bundle management"]
|
||||
pkg_ui_settings_plugin_inventory["ui-settings-plugin-inventory"]
|
||||
pkg_plugin_market["plugin-market"]
|
||||
svc_pluginMarket["ctx.pluginMarket<br/>Plugin market index reader"]
|
||||
pkg_client_ui_plugin_market["client-ui-plugin-market"]
|
||||
@@ -558,7 +557,6 @@ flowchart LR
|
||||
svc_otel --> pkg_host_product_telemetry_otel
|
||||
svc_otel --> pkg_session_telemetry_otel
|
||||
svc_pluginManager --> pkg_plugin_manager
|
||||
svc_pluginManager --> pkg_ui_settings_plugin_inventory
|
||||
svc_pluginMarket --> pkg_client_ui_plugin_market
|
||||
svc_pluginMarket --> pkg_plugin_market
|
||||
svc_pluginRecommendations --> pkg_client_ui_plugin_recommendations
|
||||
@@ -677,7 +675,7 @@ flowchart LR
|
||||
| `ctx.translator` | `service` | [`experimental-translator`](../packages/experimental/translator) | - | [`experimental-client-ui-cot-translation`](../packages/experimental/client-ui-cot-translation) | - | Resolves Google or Bing requests and retains shared experimental records through the active Session writer. |
|
||||
| `ctx.hmr` | `core` | [`hmr`](../packages/boot/hmr) | - | [`app-boot`](../packages/boot/app-boot) | - | Owns module and exact configuration watchers; application mutations share its queue and automatic reloads await the application file lock. |
|
||||
| `ctx.pluginRegistryProbe` | `core` | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | Races public registry responses on the Host; the Client owns the initial registry recommendation. |
|
||||
| `ctx.pluginManager` | `core` | [`plugin-manager`](../packages/boot/plugin-manager) | - | [`plugin-manager`](../packages/boot/plugin-manager), `ui-settings-plugin-inventory` | - | Shares profile package operations with the CLI and reports persisted and running state to Web and agent callers. |
|
||||
| `ctx.pluginManager` | `core` | [`plugin-manager`](../packages/boot/plugin-manager) | - | [`plugin-manager`](../packages/boot/plugin-manager) | - | Shares profile package operations with the CLI and reports persisted and running state to Web and agent callers. |
|
||||
| `ctx.pluginMarket` | `core` | [`plugin-market`](../packages/boot/plugin-market) | - | [`client-ui-plugin-market`](../packages/client/ui-plugin-market), [`plugin-market`](../packages/boot/plugin-market) | - | Fetches and validates the index sources the user configures; installation goes through the plugin manager. |
|
||||
| `ctx.profileContext` | `core` | [`app-boot`](../packages/boot/app-boot) | - | [`plugin-manager`](../packages/boot/plugin-manager) | - | The dsh launcher supplies data-only profile locations and composition inputs; reload scheduling belongs to dsh-hmr. |
|
||||
| `ctx.connection` | `core` | [`client-connection`](../packages/client/connection) | - | [`api-gateway`](../packages/api/gateway), [`host-frontend-static`](../packages/host/frontend-static) | - | Applies source policy and shared HTTP request dispatch; credential verification belongs to ConnectionAuthentication, and API adapters register endpoints and streams. |
|
||||
|
||||
@@ -31,7 +31,6 @@ flowchart LR
|
||||
svc_pluginRegistryProbe["ctx.pluginRegistryProbe<br/>Host registry response comparison"]
|
||||
pkg_plugin_manager["plugin-manager"]
|
||||
svc_pluginManager["ctx.pluginManager<br/>Current-profile plugin and bundle management"]
|
||||
pkg_ui_settings_plugin_inventory["ui-settings-plugin-inventory"]
|
||||
pkg_plugin_market["plugin-market"]
|
||||
svc_pluginMarket["ctx.pluginMarket<br/>Plugin market index reader"]
|
||||
pkg_client_ui_plugin_market["client-ui-plugin-market"]
|
||||
@@ -560,7 +559,6 @@ flowchart LR
|
||||
svc_otel --> pkg_host_product_telemetry_otel
|
||||
svc_otel --> pkg_session_telemetry_otel
|
||||
svc_pluginManager --> pkg_plugin_manager
|
||||
svc_pluginManager --> pkg_ui_settings_plugin_inventory
|
||||
svc_pluginMarket --> pkg_client_ui_plugin_market
|
||||
svc_pluginMarket --> pkg_plugin_market
|
||||
svc_pluginRecommendations --> pkg_client_ui_plugin_recommendations
|
||||
@@ -679,7 +677,7 @@ flowchart LR
|
||||
| `ctx.translator` | `service` | [`experimental-translator`](../packages/experimental/translator) | - | [`experimental-client-ui-cot-translation`](../packages/experimental/client-ui-cot-translation) | - | 解析 Google 或 Bing 请求,并可选保留统一的实验性 Session 记录。 |
|
||||
| `ctx.hmr` | `core` | [`hmr`](../packages/boot/hmr) | - | [`app-boot`](../packages/boot/app-boot) | - | 负责模块和精确配置监听;应用修改共用其队列,自动重载等待应用文件锁。 |
|
||||
| `ctx.pluginRegistryProbe` | `core` | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | 在 Host 上并发比较公共安装源响应;初始安装源推荐由 Client 负责。 |
|
||||
| `ctx.pluginManager` | `core` | [`plugin-manager`](../packages/boot/plugin-manager) | - | [`plugin-manager`](../packages/boot/plugin-manager), `ui-settings-plugin-inventory` | - | 与 CLI 共享 profile 包操作,并向 Web 和 Agent 调用方分别报告持久状态与运行状态。 |
|
||||
| `ctx.pluginManager` | `core` | [`plugin-manager`](../packages/boot/plugin-manager) | - | [`plugin-manager`](../packages/boot/plugin-manager) | - | 与 CLI 共享 profile 包操作,并向 Web 和 Agent 调用方分别报告持久状态与运行状态。 |
|
||||
| `ctx.pluginMarket` | `core` | [`plugin-market`](../packages/boot/plugin-market) | - | [`client-ui-plugin-market`](../packages/client/ui-plugin-market), [`plugin-market`](../packages/boot/plugin-market) | - | 获取并校验用户配置的索引源;安装通过插件管理器完成。 |
|
||||
| `ctx.profileContext` | `core` | [`app-boot`](../packages/boot/app-boot) | - | [`plugin-manager`](../packages/boot/plugin-manager) | - | dsh launcher 提供纯数据形式的 profile 位置与组合输入;重载调度由 dsh-hmr 负责。 |
|
||||
| `ctx.connection` | `core` | [`client-connection`](../packages/client/connection) | - | [`api-gateway`](../packages/api/gateway), [`host-frontend-static`](../packages/host/frontend-static) | - | 执行来源策略与共享 HTTP 请求分发;凭据验证归 ConnectionAuthentication,API 适配器注册端点和流。 |
|
||||
|
||||
@@ -2877,14 +2877,14 @@ export interface Config {
|
||||
|
||||
- `inject`: `pluginManager`
|
||||
- `refs`: [`NpmFileSource`](subsystems/boot.md) · `Volatile` (`@deepseek-ai/cordis`)
|
||||
- `source`: [`packages/boot/plugin-market/src/index.ts:44`](../packages/boot/plugin-market/src/index.ts)
|
||||
- `source`: [`packages/boot/plugin-market/src/index.ts:45`](../packages/boot/plugin-market/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Index sources and fetch limits. */
|
||||
export interface Config {
|
||||
/** Index URLs in display order; Settings and `setIndexes` write this field without remounting the service. */
|
||||
indexes: Volatile<string[]>
|
||||
/** Deadline for one index fetch, including the body. */
|
||||
/** Deadline for an HTTP index or detail file request, including its body. */
|
||||
fetchTimeoutMs: number
|
||||
/** Largest accepted index body in bytes. */
|
||||
maxBytes: number
|
||||
@@ -2900,7 +2900,7 @@ export interface Config {
|
||||
detailCacheMaxBytes: number
|
||||
/** Directory of the partial clones, relative to the profile directory; absent means `.plugin-market/repositories`. */
|
||||
detailCacheDir?: string
|
||||
/** Deadline of one Git command of the clone fallback. */
|
||||
/** Deadline for a Git index read and for each Git command used to read an index or plugin details. */
|
||||
detailGitTimeoutMs: number
|
||||
/** npm file CDNs read in order; a read's `npmFileSources` moves the CDNs it names first. */
|
||||
detailNpmFileSources: NpmFileSource[]
|
||||
@@ -5179,7 +5179,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-working-directory`
|
||||
|
||||
- `inject`: `fs` · `sessionProjections` · `systemPrompt`
|
||||
- `source`: [`packages/session/working-directory/src/index.ts:65`](../packages/session/working-directory/src/index.ts)
|
||||
- `source`: [`packages/session/working-directory/src/index.ts:70`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Deployment default for Sessions without an original project directory. */
|
||||
@@ -5275,8 +5275,6 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
|
||||
| `@deepseek-ai/dsh-client-ui-settings` | — | [`packages/client/ui-settings/src/index.ts`](../packages/client/ui-settings/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-agent-loop` | — | [`packages/client/ui-settings-agent-loop/src/index.ts`](../packages/client/ui-settings-agent-loop/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-general` | — | [`packages/client/ui-settings-general/src/index.ts`](../packages/client/ui-settings-general/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-plugin-inventory` | — | [`packages/client/ui-settings-plugin-inventory/src/index.ts`](../packages/client/ui-settings-plugin-inventory/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-plugins` | — | [`packages/client/ui-settings-plugins/src/index.ts`](../packages/client/ui-settings-plugins/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-session-log` | — | [`packages/client/ui-settings-session-log/src/index.ts`](../packages/client/ui-settings-session-log/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-shell` | — | [`packages/client/ui-settings-shell/src/index.ts`](../packages/client/ui-settings-shell/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-subagent` | — | [`packages/client/ui-settings-subagent/src/index.ts`](../packages/client/ui-settings-subagent/src/index.ts) |
|
||||
|
||||
@@ -2879,14 +2879,14 @@ export interface Config {
|
||||
|
||||
- `inject`: `pluginManager`
|
||||
- `refs`: [`NpmFileSource`](subsystems/boot.zh.md) · `Volatile` (`@deepseek-ai/cordis`)
|
||||
- `source`: [`packages/boot/plugin-market/src/index.ts:44`](../packages/boot/plugin-market/src/index.ts)
|
||||
- `source`: [`packages/boot/plugin-market/src/index.ts:45`](../packages/boot/plugin-market/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Index sources and fetch limits. */
|
||||
export interface Config {
|
||||
/** Index URLs in display order; Settings and `setIndexes` write this field without remounting the service. */
|
||||
indexes: Volatile<string[]>
|
||||
/** Deadline for one index fetch, including the body. */
|
||||
/** Deadline for an HTTP index or detail file request, including its body. */
|
||||
fetchTimeoutMs: number
|
||||
/** Largest accepted index body in bytes. */
|
||||
maxBytes: number
|
||||
@@ -2902,7 +2902,7 @@ export interface Config {
|
||||
detailCacheMaxBytes: number
|
||||
/** Directory of the partial clones, relative to the profile directory; absent means `.plugin-market/repositories`. */
|
||||
detailCacheDir?: string
|
||||
/** Deadline of one Git command of the clone fallback. */
|
||||
/** Deadline for a Git index read and for each Git command used to read an index or plugin details. */
|
||||
detailGitTimeoutMs: number
|
||||
/** npm file CDNs read in order; a read's `npmFileSources` moves the CDNs it names first. */
|
||||
detailNpmFileSources: NpmFileSource[]
|
||||
@@ -5181,7 +5181,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-working-directory`
|
||||
|
||||
- `inject`: `fs` · `sessionProjections` · `systemPrompt`
|
||||
- `source`: [`packages/session/working-directory/src/index.ts:65`](../packages/session/working-directory/src/index.ts)
|
||||
- `source`: [`packages/session/working-directory/src/index.ts:70`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Deployment default for Sessions without an original project directory. */
|
||||
@@ -5277,8 +5277,6 @@ export interface Config {
|
||||
| `@deepseek-ai/dsh-client-ui-settings` | — | [`packages/client/ui-settings/src/index.ts`](../packages/client/ui-settings/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-agent-loop` | — | [`packages/client/ui-settings-agent-loop/src/index.ts`](../packages/client/ui-settings-agent-loop/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-general` | — | [`packages/client/ui-settings-general/src/index.ts`](../packages/client/ui-settings-general/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-plugin-inventory` | — | [`packages/client/ui-settings-plugin-inventory/src/index.ts`](../packages/client/ui-settings-plugin-inventory/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-plugins` | — | [`packages/client/ui-settings-plugins/src/index.ts`](../packages/client/ui-settings-plugins/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-session-log` | — | [`packages/client/ui-settings-session-log/src/index.ts`](../packages/client/ui-settings-session-log/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-shell` | — | [`packages/client/ui-settings-shell/src/index.ts`](../packages/client/ui-settings-shell/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-subagent` | — | [`packages/client/ui-settings-subagent/src/index.ts`](../packages/client/ui-settings-subagent/src/index.ts) |
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
en: 9c2680c175632a58
|
||||
zh: 46927fca484b5df0
|
||||
/cookbook-live-configuration-forms/3-verify-editing:
|
||||
en: dc5dc7ab4c211b97
|
||||
zh: 88f8af745c576a6d
|
||||
en: cf8d614d67a0ade6
|
||||
zh: 92a7b53ce83e967a
|
||||
/cookbook-live-configuration-forms/4-contribute-to-another-plugin-s-page:
|
||||
en: 0abb582a1a25b3d9
|
||||
zh: 6078a707324ec515
|
||||
|
||||
@@ -39,7 +39,7 @@ Give each instance a unique profile entry id. The base bundle mounts settings an
|
||||
|
||||
Change a field in Plugins and save. Verify the profile patch, the next consumer operation, unchanged plugin instance identity, and restoration after restart. Reject an invalid value and verify that neither the file nor the live value changed.
|
||||
|
||||
Custom plugin pages receive `form.state` and `form.mutate(operations, expectedRevision)` from the Plugins page owner. The Host validates full Config and applies edits through ConfigEditor and volatile HMR. The [plugin settings package](../../packages/client/ui-settings-plugins/README.md) owns the existing card examples.
|
||||
Custom plugin pages receive `form.state` and `form.mutate(operations, expectedRevision)` from the Plugins page owner. The Host validates full Config and applies edits through ConfigEditor and volatile HMR. The [Plugins page README](../../packages/client/ui-plugin-manager/README.md#configuration-pages) lists the slots such a page registers into and how a `settings.section` entry also appears there; [ui-settings-shell](../../packages/client/ui-settings-shell/README.md) is an existing page.
|
||||
|
||||
## 4. Contribute to another plugin's page
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ export function apply(ctx: Context, config: Config): void {
|
||||
|
||||
在插件页面修改字段并保存。验证 profile patch、消费者下一次操作、插件实例标识不变,以及重启后的恢复。提交无效值,并确认文件和即时值均未改变。
|
||||
|
||||
自定义插件页面从 Plugins 页面所有者接收 `form.state` 和 `form.mutate(operations, expectedRevision)`。Host 校验完整 Config,并通过 ConfigEditor 和 volatile HMR 应用修改。[插件设置包](../../packages/client/ui-settings-plugins/README.zh.md) 提供现有卡片示例。
|
||||
自定义插件页面从 Plugins 页面所有者接收 `form.state` 和 `form.mutate(operations, expectedRevision)`。Host 校验完整 Config,并通过 ConfigEditor 和 volatile HMR 应用修改。[插件页面 README](../../packages/client/ui-plugin-manager/README.zh.md#configuration-pages) 列出此类页面可注册的 slot,以及 `settings.section` 条目如何同时出现在那里;[ui-settings-shell](../../packages/client/ui-settings-shell/README.zh.md) 是一个现有页面。
|
||||
|
||||
## 4. 向其他插件的页面贡献内容
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
|
||||
| `workflow/log` | `emit` | [`packages/workflow/workflow/src/index.ts:58`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
|
||||
| `workflow/phase` | `emit` | [`packages/workflow/workflow/src/index.ts:51`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
|
||||
| `workflow/start` | `emit` | [`packages/workflow/workflow/src/index.ts:43`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | - |
|
||||
| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:34`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
|
||||
| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:32`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
|
||||
| `workspace/session-activity` | `waterfall` | [`packages/workspace/workspace/src/index.ts:130`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`waterfall`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
|
||||
| `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) |
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
| `workflow/log` | `emit` | [`packages/workflow/workflow/src/index.ts:58`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
|
||||
| `workflow/phase` | `emit` | [`packages/workflow/workflow/src/index.ts:51`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
|
||||
| `workflow/start` | `emit` | [`packages/workflow/workflow/src/index.ts:43`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | - |
|
||||
| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:34`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
|
||||
| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:32`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
|
||||
| `workspace/session-activity` | `waterfall` | [`packages/workspace/workspace/src/index.ts:130`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`waterfall`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
|
||||
| `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) |
|
||||
|
||||
@@ -202,8 +202,6 @@ flowchart TD
|
||||
pkg_client_ui_settings_agent_loop["client-ui-settings-agent-loop"]
|
||||
pkg_client_ui_settings_general["client-ui-settings-general"]
|
||||
pkg_client_ui_settings_models["client-ui-settings-models"]
|
||||
pkg_client_ui_settings_plugin_inventory["client-ui-settings-plugin-inventory"]
|
||||
pkg_client_ui_settings_plugins["client-ui-settings-plugins"]
|
||||
pkg_client_ui_settings_session_log["client-ui-settings-session-log"]
|
||||
pkg_client_ui_settings_shell["client-ui-settings-shell"]
|
||||
pkg_client_ui_settings_subagent["client-ui-settings-subagent"]
|
||||
@@ -1568,6 +1566,7 @@ flowchart TD
|
||||
pkg_sdk_jsonrpc_server --> pkg_goal
|
||||
pkg_sdk_jsonrpc_server --> pkg_llm
|
||||
pkg_sdk_jsonrpc_server --> pkg_llm_deepseek_api_key
|
||||
pkg_sdk_jsonrpc_server --> pkg_permission_presets
|
||||
pkg_sdk_jsonrpc_server --> pkg_schedule
|
||||
pkg_sdk_jsonrpc_server --> pkg_scope
|
||||
pkg_sdk_jsonrpc_server --> pkg_sdk_protocol
|
||||
@@ -1666,8 +1665,6 @@ flowchart TD
|
||||
| [`client-ui-settings-agent-loop`](../packages/client/ui-settings-agent-loop) | `client` | — |
|
||||
| [`client-ui-settings-general`](../packages/client/ui-settings-general) | `client` | — |
|
||||
| [`client-ui-settings-models`](../packages/client/ui-settings-models) | `client` | — |
|
||||
| [`client-ui-settings-plugin-inventory`](../packages/client/ui-settings-plugin-inventory) | `client` | — |
|
||||
| [`client-ui-settings-plugins`](../packages/client/ui-settings-plugins) | `client` | — |
|
||||
| [`client-ui-settings-session-log`](../packages/client/ui-settings-session-log) | `client` | — |
|
||||
| [`client-ui-settings-shell`](../packages/client/ui-settings-shell) | `client` | — |
|
||||
| [`client-ui-settings-subagent`](../packages/client/ui-settings-subagent) | `client` | — |
|
||||
@@ -1963,5 +1960,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), [`goal`](../packages/goal/goal), [`llm`](../packages/llm/llm), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`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), [`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) |
|
||||
<!-- END GENERATED module-graph:packages -->
|
||||
@@ -204,8 +204,6 @@ flowchart TD
|
||||
pkg_client_ui_settings_agent_loop["client-ui-settings-agent-loop"]
|
||||
pkg_client_ui_settings_general["client-ui-settings-general"]
|
||||
pkg_client_ui_settings_models["client-ui-settings-models"]
|
||||
pkg_client_ui_settings_plugin_inventory["client-ui-settings-plugin-inventory"]
|
||||
pkg_client_ui_settings_plugins["client-ui-settings-plugins"]
|
||||
pkg_client_ui_settings_session_log["client-ui-settings-session-log"]
|
||||
pkg_client_ui_settings_shell["client-ui-settings-shell"]
|
||||
pkg_client_ui_settings_subagent["client-ui-settings-subagent"]
|
||||
@@ -1570,6 +1568,7 @@ flowchart TD
|
||||
pkg_sdk_jsonrpc_server --> pkg_goal
|
||||
pkg_sdk_jsonrpc_server --> pkg_llm
|
||||
pkg_sdk_jsonrpc_server --> pkg_llm_deepseek_api_key
|
||||
pkg_sdk_jsonrpc_server --> pkg_permission_presets
|
||||
pkg_sdk_jsonrpc_server --> pkg_schedule
|
||||
pkg_sdk_jsonrpc_server --> pkg_scope
|
||||
pkg_sdk_jsonrpc_server --> pkg_sdk_protocol
|
||||
@@ -1668,8 +1667,6 @@ flowchart TD
|
||||
| [`client-ui-settings-agent-loop`](../packages/client/ui-settings-agent-loop) | `client` | — |
|
||||
| [`client-ui-settings-general`](../packages/client/ui-settings-general) | `client` | — |
|
||||
| [`client-ui-settings-models`](../packages/client/ui-settings-models) | `client` | — |
|
||||
| [`client-ui-settings-plugin-inventory`](../packages/client/ui-settings-plugin-inventory) | `client` | — |
|
||||
| [`client-ui-settings-plugins`](../packages/client/ui-settings-plugins) | `client` | — |
|
||||
| [`client-ui-settings-session-log`](../packages/client/ui-settings-session-log) | `client` | — |
|
||||
| [`client-ui-settings-shell`](../packages/client/ui-settings-shell) | `client` | — |
|
||||
| [`client-ui-settings-subagent`](../packages/client/ui-settings-subagent) | `client` | — |
|
||||
@@ -1965,5 +1962,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), [`goal`](../packages/goal/goal), [`llm`](../packages/llm/llm), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`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), [`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) |
|
||||
<!-- END GENERATED module-graph:packages -->
|
||||
@@ -300,8 +300,8 @@
|
||||
en: e8dd0cebbb930eb7
|
||||
zh: e8dd0cebbb930eb7
|
||||
/session-persistence-event-catalog/events/working-directory/working-directory-change-log-only:
|
||||
en: fbdf3777f155f458
|
||||
zh: 98dc9a9351c07415
|
||||
en: 27f0761cbdd6fe2f
|
||||
zh: 33528f333498132d
|
||||
/session-persistence-event-catalog/events/workspace:
|
||||
en: 63ee1a85e4b59ae3
|
||||
zh: 63ee1a85e4b59ae3
|
||||
@@ -1497,8 +1497,8 @@
|
||||
en: bef51e0442ebb903
|
||||
zh: 240ebeb160533d8c
|
||||
/session-persistence-event-catalog/resolved-persistence-types/cwd:
|
||||
en: 6a6f06c1421739c3
|
||||
zh: 0e28ae71c2e84a1d
|
||||
en: 2809c921c6996791
|
||||
zh: 80b15177561766d7
|
||||
/session-persistence-event-catalog/resolved-persistence-types/decision-durationms-exitcode-handlerid:
|
||||
en: a99ac57bbec0370f
|
||||
zh: 9073329e324a66e0
|
||||
@@ -1935,8 +1935,8 @@
|
||||
en: c6e1e91281b3f9c2
|
||||
zh: 33225e83b0bd8cff
|
||||
/session-persistence-event-catalog/resolved-persistence-types/kind-working-directory:
|
||||
en: f688f9a75f549c23
|
||||
zh: 03ccb103398fc27b
|
||||
en: b28ca6b37f5a338d
|
||||
zh: 4c4f2f05721b8b62
|
||||
/session-persistence-event-catalog/resolved-persistence-types/max-tokens-messages-model-thinking:
|
||||
en: 3216b23c131d0070
|
||||
zh: 73ca171c6014f16e
|
||||
|
||||
@@ -1329,7 +1329,7 @@ Source: [`packages/web/web-search-deepseek/src/provider.ts:89`](../packages/web/
|
||||
}
|
||||
```
|
||||
|
||||
Source: [`packages/session/working-directory/src/index.ts:57`](../packages/session/working-directory/src/index.ts)
|
||||
Source: [`packages/session/working-directory/src/index.ts:55`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
### `workspace/*`
|
||||
|
||||
@@ -6216,7 +6216,7 @@ Sources: [`packages/compaction/compaction/src/types.ts:24`](../packages/compacti
|
||||
|
||||
SHA-256: `da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582`
|
||||
|
||||
Sources: [`packages/session/working-directory/src/index.ts:57`](../packages/session/working-directory/src/index.ts)
|
||||
Sources: [`packages/session/working-directory/src/index.ts:55`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
| Property | Presence | Type |
|
||||
|---|---|---|
|
||||
@@ -7970,7 +7970,7 @@ Sources: [`packages/experimental/webhook/src/types.ts:75`](../packages/experimen
|
||||
|
||||
SHA-256: `2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5`
|
||||
|
||||
Sources: [`packages/session/working-directory/src/index.ts:50`](../packages/session/working-directory/src/index.ts)
|
||||
Sources: [`packages/session/working-directory/src/index.ts:48`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
| Property | Presence | Type |
|
||||
|---|---|---|
|
||||
|
||||
@@ -1331,7 +1331,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
||||
}
|
||||
```
|
||||
|
||||
来源:[`packages/session/working-directory/src/index.ts:57`](../packages/session/working-directory/src/index.ts)
|
||||
来源:[`packages/session/working-directory/src/index.ts:55`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
### `workspace/*`
|
||||
|
||||
@@ -6218,7 +6218,7 @@ SHA-256: `3e4e7683b0192c9f0e6a75c59076108f017892cdb302a98032c2632fd79c356f`
|
||||
|
||||
SHA-256: `da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582`
|
||||
|
||||
来源:[`packages/session/working-directory/src/index.ts:57`](../packages/session/working-directory/src/index.ts)
|
||||
来源:[`packages/session/working-directory/src/index.ts:55`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
| 属性 | 存在性 | 类型 |
|
||||
|---|---|---|
|
||||
@@ -7972,7 +7972,7 @@ SHA-256: `9edc162949abf93bd5ff049191b345454ba104f583937ce5580fb50f067d2b94`
|
||||
|
||||
SHA-256: `2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5`
|
||||
|
||||
来源:[`packages/session/working-directory/src/index.ts:50`](../packages/session/working-directory/src/index.ts)
|
||||
来源:[`packages/session/working-directory/src/index.ts:48`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
| 属性 | 存在性 | 类型 |
|
||||
|---|---|---|
|
||||
|
||||
Generated
+2
-2
@@ -161,7 +161,7 @@
|
||||
{"digest":"2142e391b9ccb60d487afcf373ce74db98d952f69e8289eddb352a7e16e996c5","names":[],"sources":[]},
|
||||
{"digest":"2152caf1a71e588e4df2358a806dea24936c1c47131134f01a12939d12cdc0c0","names":["packages/team/agent-team/src/types.ts#TeamMessageSource"],"sources":["packages/team/agent-team/src/types.ts:121"]},
|
||||
{"digest":"21fb6a90d5068f6a0003b7ab316ed2f56342477146a65c00db0f13c4d8df667d","names":[],"sources":[]},
|
||||
{"digest":"2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5","names":[],"sources":["packages/session/working-directory/src/index.ts:50"]},
|
||||
{"digest":"2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5","names":[],"sources":["packages/session/working-directory/src/index.ts:48"]},
|
||||
{"digest":"224aa11d4d5f88c450822d01b99e6ca5e3a9c7f26a5ede10bae33384a09ef4dc","names":[],"sources":[]},
|
||||
{"digest":"234142ee4f996f38cc9fa3b8b3e3de29b03c9aefe5ebf6c224eddd564505aa85","names":[],"sources":[]},
|
||||
{"digest":"237c004c73b6b288246816e0d7fde16e09c63a47aa3b1227383d7afe58666163","names":[],"sources":[]},
|
||||
@@ -608,7 +608,7 @@
|
||||
{"digest":"d9196086e41e4dd5c2ce87f5c25529c8112a1731d258cf0728747d41a9ee3241","names":[],"sources":[]},
|
||||
{"digest":"d9c462b9f62fdd3efc76a44b9524dc8781f6b91cd9c7e584b17d971defafebab","names":["packages/llm/llm/src/message.ts#ToolMessageSource"],"sources":["packages/llm/llm/src/message.ts:28"]},
|
||||
{"digest":"d9edf1862e4471d6ad8a106a3f4160e0643874368707d50ecd8e27e5ee7a2567","names":[],"sources":[]},
|
||||
{"digest":"da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582","names":[],"sources":["packages/session/working-directory/src/index.ts:57"]},
|
||||
{"digest":"da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582","names":[],"sources":["packages/session/working-directory/src/index.ts:55"]},
|
||||
{"digest":"dacf3d5f3e4ff619c1320e64a48dec5e7ecd7870bece65fbd449a0e63adfa521","names":[],"sources":[]},
|
||||
{"digest":"db06ef35b27a38425046b2228fa6bce9582abe140d781d363137eb2f4d233a1c","names":[],"sources":[]},
|
||||
{"digest":"db6c5246911d47a7969f6b4cb47c7d0dbbde75c402710b22ace3672fa97bebe0","names":[],"sources":[]},
|
||||
|
||||
@@ -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.3/settings-section-plugins-page/guide.md
|
||||
/:
|
||||
en: dab406781a6bcb3a
|
||||
zh: 8d94c715bf9ec1b6
|
||||
/built-in-plugins-section-removal:
|
||||
en: 2483533f0eab34cf
|
||||
zh: 9e7be97df303c363
|
||||
/built-in-plugins-section-removal/change:
|
||||
en: 513dfd0788a54e09
|
||||
zh: 6b589f0dc07a85d7
|
||||
/built-in-plugins-section-removal/migration:
|
||||
en: b7d0c582c0bfd1cd
|
||||
zh: ac670eb81450b9ef
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
kind: upgrade-guide
|
||||
description: "Settings → Built-in plugins, its two packages, and the `settings.plugins.tab` slot are removed; plugin settings pages also appear on the Plugins page."
|
||||
---
|
||||
|
||||
# Built-in plugins section removal
|
||||
|
||||
English | [中文](guide.zh.md)
|
||||
|
||||
## Change
|
||||
|
||||
**Settings → Built-in plugins** and its packages `@deepseek-ai/dsh-client-ui-settings-plugins` and `@deepseek-ai/dsh-client-ui-settings-plugin-inventory` are removed, together with the `settings.plugins.tab` slot and `SettingsPluginsTabOwnerProps`. **Settings → Plugins** opens the Plugins page instead. `settings.section` entries still appear in Settings. The Plugins page also shows an entry on the listed bundle row whose module is the registering package, or on that bundle's page, when the row or bundle registers no `plugins.row.config` or `plugins.bundle.config` of its own; there the entry's `close` returns to the view it was opened from instead of closing Settings. Both surfaces render entries through the `settings.section.view` Factory, which ui-settings-general registers and which declares `settings.section`.
|
||||
|
||||
## Migration
|
||||
|
||||
1. Remove both removed packages from profile manifests and from `cordis.yml` rows that name them.
|
||||
2. Move any `settings.plugins.tab` contribution to a `settings.section` page or a Plugins page slot such as `plugins.bundle.config`.
|
||||
3. A `settings.section` page whose `close()` call must leave Settings, such as after starting a Session, navigates there itself, because on the Plugins page `close()` only returns to the previous view.
|
||||
4. Open the plugin's bundle on the Plugins page and confirm its settings page appears there, unless the row or bundle registers its own configuration, and in Settings.
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
kind: upgrade-guide
|
||||
description: "删除「设置 → 内置插件」、它的两个包和 `settings.plugins.tab` slot;插件设置页同时出现在插件页面。"
|
||||
---
|
||||
|
||||
# 删除内置插件分区
|
||||
|
||||
[English](guide.md) | 中文
|
||||
|
||||
## 变更
|
||||
|
||||
「设置 → 内置插件」及其包 `@deepseek-ai/dsh-client-ui-settings-plugins` 和 `@deepseek-ai/dsh-client-ui-settings-plugin-inventory` 已删除,`settings.plugins.tab` slot 和 `SettingsPluginsTabOwnerProps` 也一并删除。「设置 → 插件管理」改为打开插件页面。`settings.section` 条目仍显示在设置中。当模块与注册包相同的已列出 bundle 行、或该 bundle 本身没有注册自己的 `plugins.row.config` 或 `plugins.bundle.config` 时,插件页面也会在该行或该 bundle 页面上显示这个条目;在插件页面上,条目的 `close` 回到打开它的视图,而不是关闭设置。两处都通过 `settings.section.view` Factory 渲染条目,该 Factory 由 ui-settings-general 注册并声明 `settings.section`。
|
||||
|
||||
## 迁移
|
||||
|
||||
1. 从 profile manifest 和 `cordis.yml` 中删除指向这两个已删除包的条目。
|
||||
2. 把 `settings.plugins.tab` 贡献改为 `settings.section` 页面,或 `plugins.bundle.config` 等插件页面 slot。
|
||||
3. 调用 `close()` 后必须离开设置的 `settings.section` 页面(例如启动 Session 之后)需要自行导航,因为在插件页面上 `close()` 只回到上一个视图。
|
||||
4. 在插件页面打开该插件的 bundle,确认其设置页出现在那里(该行或 bundle 注册了自己的配置时除外)和设置中。
|
||||
@@ -70,6 +70,7 @@
|
||||
"test:expected:refresh": "DSH_SNAPSHOT=refresh vitest run --config vitest.expected.config.ts",
|
||||
"test:approval-policy": "node --test .github/review-ownership/check-approval.test.mjs .github/review-ownership/blame-ownership.test.mjs .github/review-ownership/author-weight.test.mjs",
|
||||
"test:issue-management": "node .github/issue-management/policy.test.mjs",
|
||||
"test:stale-pull-requests": "node --test .github/stale-pull-requests/remind.test.mjs",
|
||||
"test:snapshot": "vitest run --config vitest.snapshot.config.ts",
|
||||
"test:snapshot:record": "DSH_SNAPSHOT=record vitest run --config vitest.snapshot.config.ts --update",
|
||||
"test:snapshot:refresh": "DSH_SNAPSHOT=refresh vitest run --config vitest.snapshot.config.ts",
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
en: 87679c51aa3693f5
|
||||
zh: 11684a48a5806afb
|
||||
/deepseek-ai-dsh-plugin-manager/use-this-package:
|
||||
en: 9dba73eeabe9887f
|
||||
zh: 19291d764da21077
|
||||
en: ff51b012b845dd8a
|
||||
zh: 1c6131057ff98844
|
||||
/deepseek-ai-dsh-plugin-manager/use-this-package/version-compatibility-and-exemptions:
|
||||
en: 483285658e267dd5
|
||||
zh: 846bec2daac59a96
|
||||
@@ -30,8 +30,8 @@
|
||||
en: c224bfcb3eb3dbd2
|
||||
zh: 8b9c96970a90dccc
|
||||
/deepseek-ai-dsh-plugin-manager/further-exploration:
|
||||
en: c6538243d8702a0d
|
||||
zh: 04a82d923353c75f
|
||||
en: b151a14acbf93f00
|
||||
zh: f304e2ea5c7c7d0f
|
||||
/deepseek-ai-dsh-plugin-manager/model-experience:
|
||||
en: 215e7ba838619b7b
|
||||
zh: a311da3843709f90
|
||||
@@ -48,8 +48,8 @@
|
||||
en: c29f60be7f3edc1a
|
||||
zh: d9b9388b96ef95cc
|
||||
/deepseek-ai-dsh-plugin-manager/known-limitations-and-deferred-work:
|
||||
en: 89306b478cb75b3b
|
||||
zh: f2f50c88114fec99
|
||||
en: d8ea2d28e9e8c3e7
|
||||
zh: 4efd7e073dde1b96
|
||||
/deepseek-ai-dsh-plugin-manager/known-limitations-and-deferred-work/failure-behavior:
|
||||
en: 3fde425e82bbd0f4
|
||||
zh: 531e2365e7d67480
|
||||
|
||||
@@ -28,7 +28,7 @@ Manage the current profile's plugins without editing configuration by hand. Enab
|
||||
<a id="use-this-package"></a>
|
||||
## Use this package
|
||||
|
||||
Base-backed profiles provide the manager. In Web, the sidebar's **Plugins** page ([ui-plugin-manager](../../client/ui-plugin-manager/README.md)) manages the profile's bundles and their uniquely addressable rows; the Settings Plugin list stays read-only. Agent-preset rows remain read-only. The `plugin_manager` tool exposes the same operations and is enabled in the Standard and Creator presets. Other Web presets keep it disabled by default. The full SDK profile enables it at profile scope in native/PTC mode; without HMR, saved changes return `restart-required` with `no-hmr` and apply after the runtime restarts. Every tool action requires `danger-full-access` or approval for that call. Under lower sandbox modes, `ask` requests approval; `never`, rejection, cancellation, or an unavailable approval channel prevents execution. An approval leaves the session permission mode unchanged. Profile changes persist across sessions, and installed Host code executes in-process outside the workspace sandbox. Dependency build-script approval remains separate.
|
||||
Base-backed profiles provide the manager. In Web, the sidebar's **Plugins** page ([ui-plugin-manager](../../client/ui-plugin-manager/README.md)) manages the profile's bundles and their uniquely addressable rows. Agent-preset rows remain read-only. The `plugin_manager` tool exposes the same operations and is enabled in the Standard and Creator presets. Other Web presets keep it disabled by default. The full SDK profile enables it at profile scope in native/PTC mode; without HMR, saved changes return `restart-required` with `no-hmr` and apply after the runtime restarts. Every tool action requires `danger-full-access` or approval for that call. Under lower sandbox modes, `ask` requests approval; `never`, rejection, cancellation, or an unavailable approval channel prevents execution. An approval leaves the session permission mode unchanged. Profile changes persist across sessions, and installed Host code executes in-process outside the workspace sandbox. Dependency build-script approval remains separate.
|
||||
|
||||
For a deployment without agent presets other than the full SDK profile, enable the tool in the profile patch. Package installation/removal requires pnpm on `PATH` or an explicit `pnpmCommand`; a launcher-provided package manager takes precedence. Preset-backed sessions use their preset’s `tool-plugin-manager` entry.
|
||||
|
||||
@@ -143,7 +143,6 @@ The `@deepseek-ai/dsh-plugin-manager/diagnostic` entry supplies Desktop Host and
|
||||
- [App boot](../app-boot/README.md) — profile layers and startup policy.
|
||||
- [Plugin inventory](../../host/plugin-inventory/README.md) — current Loader and preset observations.
|
||||
- [Plugin manager page](../../client/ui-plugin-manager/README.md) — the Web sidebar page over this service.
|
||||
- [Plugin settings](../../client/ui-settings-plugin-inventory/README.md) — the read-only Web inventory.
|
||||
|
||||
<a id="model-experience"></a>
|
||||
## Model Experience
|
||||
@@ -178,7 +177,7 @@ Tool results append to the transcript. Enabling or disabling other tools can cha
|
||||
- Startup-only profiles cannot remove packages used to start the current process; stop it and use `dsh plugin`.
|
||||
- The manager cannot disable its own management components, change another profile, or edit an agent preset's composition.
|
||||
- A failed removal may leave dependencies partially changed, and a failed or cancelled installation can leave downloaded files under `node_modules` or the pnpm store. Inactive dependencies with missing files remain removable. Diagnostic logs remain under the profile's `.plugin-manager/logs` directory.
|
||||
- Management results describe Host activation. Browser synchronization failures appear separately in the Settings plugin list.
|
||||
- Management results describe Host activation. Browser synchronization failures appear separately in the Plugins page's synchronization notice.
|
||||
- Desktop package operations remain owned by the Desktop shell.
|
||||
|
||||
<a id="failure-behavior"></a>
|
||||
|
||||
@@ -28,7 +28,7 @@ kind: "package-reference"
|
||||
<a id="use-this-package"></a>
|
||||
## 使用本包
|
||||
|
||||
基于 base 的 profile 提供管理服务。在 Web 中,侧边栏的**插件**页([ui-plugin-manager](../../client/ui-plugin-manager/README.zh.md))管理 profile 的组合包及其能唯一定位的行;设置页的插件列表保持只读。Agent 预设条目保持只读。`plugin_manager` 工具提供相同操作,在标准和 Creator 预设中启用。其他 Web 预设仍默认禁用。完整 SDK profile 在 profile 作用域为 native/PTC 模式启用此工具;没有 HMR 时,保存的变更返回 `restart-required` 和 `no-hmr`,在运行时重启后应用。每个工具操作都要求 `danger-full-access` 或本次调用的批准。在较低沙箱模式下,`ask` 会请求审批;`never`、拒绝、取消或审批渠道不可用时均不执行。批准不改变会话的权限模式。profile 变更跨会话持久化,已安装的 Host 代码在宿主进程内运行,不受工作区沙箱限制。依赖构建脚本仍需单独批准。
|
||||
基于 base 的 profile 提供管理服务。在 Web 中,侧边栏的**插件**页([ui-plugin-manager](../../client/ui-plugin-manager/README.zh.md))管理 profile 的组合包及其能唯一定位的行。Agent 预设条目保持只读。`plugin_manager` 工具提供相同操作,在标准和 Creator 预设中启用。其他 Web 预设仍默认禁用。完整 SDK profile 在 profile 作用域为 native/PTC 模式启用此工具;没有 HMR 时,保存的变更返回 `restart-required` 和 `no-hmr`,在运行时重启后应用。每个工具操作都要求 `danger-full-access` 或本次调用的批准。在较低沙箱模式下,`ask` 会请求审批;`never`、拒绝、取消或审批渠道不可用时均不执行。批准不改变会话的权限模式。profile 变更跨会话持久化,已安装的 Host 代码在宿主进程内运行,不受工作区沙箱限制。依赖构建脚本仍需单独批准。
|
||||
|
||||
除完整 SDK profile 外,未使用 Agent 预设的部署在 profile patch 中启用工具;安装/移除包要求 PATH 中有 pnpm,或显式配置 `pnpmCommand`,启动器提供的包管理器优先;使用预设的会话由其预设中的 `tool-plugin-manager` 条目控制。
|
||||
|
||||
@@ -143,7 +143,6 @@ service 运行若在 `idleTimeoutMs` 内没有任何捕获输出即被终止,
|
||||
- [App boot](../app-boot/README.zh.md)——profile 配置层与启动策略。
|
||||
- [Plugin inventory](../../host/plugin-inventory/README.zh.md)——当前 Loader 和预设状态。
|
||||
- [插件管理页](../../client/ui-plugin-manager/README.zh.md)——基于本服务的 Web 侧边栏页面。
|
||||
- [Plugin settings](../../client/ui-settings-plugin-inventory/README.zh.md)——只读的 Web 清单。
|
||||
|
||||
<a id="model-experience"></a>
|
||||
## 模型体验
|
||||
@@ -178,7 +177,7 @@ service 运行若在 `idleTimeoutMs` 内没有任何捕获输出即被终止,
|
||||
- 仅启动时加载的 profile 不能删除当前进程启动时使用的包;停止进程后使用 `dsh plugin`。
|
||||
- 管理器不能关闭自身所需的管理组件、修改其他 profile 或编辑 agent 预设组合。
|
||||
- 失败的删除可能留下部分依赖改动,失败或被取消的安装可能在 `node_modules` 或 pnpm 缓存中留下已下载文件。文件缺失的未启用依赖仍可删除。诊断日志保留在 profile 的 `.plugin-manager/logs` 目录中。
|
||||
- 管理结果描述 Host 激活状态。浏览器同步失败会在设置的插件列表中单独显示。
|
||||
- 管理结果描述 Host 激活状态。浏览器同步失败会在插件页面的同步提示中单独显示。
|
||||
- Desktop 包管理操作仍由 Desktop shell 负责。
|
||||
|
||||
<a id="failure-behavior"></a>
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
en: 76368b6b1da79c80
|
||||
zh: 52384aee991ac542
|
||||
/deepseek-ai-dsh-plugin-market/use-this-package:
|
||||
en: fef9850d643e327f
|
||||
zh: c6e8cab773cf93b9
|
||||
en: 1b4074faca2694e2
|
||||
zh: f2d0007652139f26
|
||||
/deepseek-ai-dsh-plugin-market/use-this-package/plugin-detail-documents:
|
||||
en: 8a49fc923d4ebd95
|
||||
zh: 44b9f020e8471458
|
||||
/deepseek-ai-dsh-plugin-market/understand-the-implementation:
|
||||
en: cb56b9191fc680a1
|
||||
zh: eee0a1dfee9ea5bb
|
||||
en: f349c9da02b42ff4
|
||||
zh: a34e6e788fa20564
|
||||
/deepseek-ai-dsh-plugin-market/model-experience:
|
||||
en: 215e7ba838619b7b
|
||||
zh: a311da3843709f90
|
||||
@@ -39,8 +39,8 @@
|
||||
en: 02cf6033092eb236
|
||||
zh: cb928bfa6d39a7f7
|
||||
/deepseek-ai-dsh-plugin-market/known-limitations-and-deferred-work:
|
||||
en: a5f8aad8e45b333d
|
||||
zh: bb84782c37db2574
|
||||
en: 14b60333cd684bf2
|
||||
zh: 7547d737eceb02ba
|
||||
/deepseek-ai-dsh-plugin-market/known-limitations-and-deferred-work/dev-note:
|
||||
en: e67f633dc6fe7773
|
||||
zh: 3bb0c20c93f16f98
|
||||
@@ -28,20 +28,24 @@ The optional [custom plugin indexes bundle](../../experimental/plugin-market-bun
|
||||
|
||||
| Config | Default | Meaning |
|
||||
|---|---|---|
|
||||
| `indexes` | `[]` | Index URLs in display order. A usable URL is in canonical form and uses `http:` or `https:`, without credentials or fragment. The field is volatile: Discover, Settings, and `setIndexes` change it without remounting this service or `plugin-manager`. |
|
||||
| `fetchTimeoutMs` | `15000` | Deadline for one index fetch, including its body. |
|
||||
| `maxBytes` | `134217728` | Largest accepted index body. |
|
||||
| `indexes` | `[]` | Canonical index source URLs in display order. Discover, Settings, and `setIndexes` change this field without remounting this service or `plugin-manager`. |
|
||||
| `fetchTimeoutMs` | `15000` | Deadline for each HTTP(S) index or detail file request, including the response body. |
|
||||
| `maxBytes` | `134217728` | Largest accepted index file. |
|
||||
| `cacheTtlMs` | `600000` | Lifetime of a successfully read index document, a detail read result, and a repository's default-branch commit. |
|
||||
| `detailMaxBytes` | `1048576` | Largest detail document, and largest locale file read for one. |
|
||||
| `detailImageMaxBytes` | `5242880` | Largest image served beside a detail document. |
|
||||
| `detailRepositoryMaxBytes` | `52428800` | Largest amount one Git command adds to a partial clone; a repository whose fetch adds more is not read. |
|
||||
| `detailCacheMaxBytes` | `524288000` | Largest total size of the partial clones; least recently used ones are deleted beyond it after each fetch. |
|
||||
| `detailCacheDir` | `.plugin-market/repositories` | Directory of the partial clones, relative to the profile directory; required, as an absolute path, when the service runs outside a dsh profile. |
|
||||
| `detailGitTimeoutMs` | `60000` | Deadline of one Git command of the clone fallback. |
|
||||
| `detailGitTimeoutMs` | `60000` | Deadline for a complete Git index file read, including queue and lock waits, and for each Git command used to read an index or detail file. |
|
||||
| `detailNpmFileSources` | `['jsdelivr', 'unpkg', 'npmmirror']` | npm file CDNs read in order; a read's `npmFileSources` moves the CDNs it names first, and CDNs this list omits are not asked. |
|
||||
| `detailGitlabHosts` | `['gitlab.com']` | Hosts whose GitLab repository files API serves public repositories, compared without letter case. |
|
||||
|
||||
Settings and profile files can store any http(s) string, so the service validates each URL when it lists or reads it. `listIndexes` reports an unusable URL with its refusal, `search` and `entry` refuse it, and no request is sent to it; a repeated URL is listed once.
|
||||
An index source can be a direct JSON address such as `https://example.com/index.json` or a Git repository such as `git+https://github.com/acme/plugins.git` or `git+ssh://[email protected]/platform/plugins.git`. Direct JSON addresses use HTTP or HTTPS and exclude credentials and fragments. A Git source reads `index.json` at the repository root on the default branch. Add `?path=market%2Findex.json&ref=main` to select another repository-relative path or ref. The ref can be a branch name or a full lower-case SHA-1 commit ID.
|
||||
|
||||
Git uses the DSH Host user's Git credential helper for HTTPS or the user's SSH configuration and keys for SSH. Set up access on the machine running the Host before adding a private index. Git's `url.<base>.insteadOf` rules may rewrite the repository address to another HTTPS or SSH address. The Host reports a failed connection for the chosen address so you can correct the source or the Host's Git access.
|
||||
|
||||
The service validates each source when it lists or reads it. `listIndexes` reports an unusable URL with its refusal, and `search` and `entry` refuse to contact it. A repeated URL is listed once.
|
||||
|
||||
The Remote methods are:
|
||||
|
||||
@@ -87,7 +91,9 @@ The `plugin_market` tool lists the configured indexes, pages the plugins of one
|
||||
<a id="understand-the-implementation"></a>
|
||||
## Understand the implementation
|
||||
|
||||
The Host fetches with the process `fetch`, so the configured outbound proxy applies, and refuses redirects. The body is read up to `maxBytes`, then a fresh Worker Thread decodes it as strict UTF-8, parses it as JSON, and validates it; relative icon references resolve against the configured URL. The body's buffer moves to the Worker, and the validated index returns to the Host by structured clone. The Worker is the self-contained `lib/worker.cjs` bundle; disposal terminates it, and a Worker failure is reported as `plugin-market/fetch-failed`.
|
||||
The Host uses the process `fetch` for direct JSON addresses, so the configured outbound proxy applies. It refuses redirects for these addresses. For Git sources, it reads the index from a partial clone kept apart from detail clones. The Git read defaults to refusing HTTPS redirects and does not retry with a different remote. A fresh index read fetches the default branch or the configured branch again and reuses a pinned commit when it is cached.
|
||||
|
||||
The index is read up to `maxBytes`. A fresh Worker Thread decodes the bytes as strict UTF-8, parses them as JSON, and validates the result. Relative icon references in a direct JSON source resolve against its URL. The buffer moves to the Worker, and the validated index returns to the Host by structured clone. Disposal terminates the self-contained `lib/worker.cjs` Worker. A Worker failure is reported as `plugin-market/fetch-failed`.
|
||||
|
||||
Concurrent reads of one URL share one fetch. A successful document is cached for `cacheTtlMs`; `refresh` bypasses the cache. Each fetched document gets a new `fetchedAt`, and the cached document stays answerable by its `fetchedAt` until a later fetch replaces it. A failed read records its message for `listIndexes` and keeps no document. A read that finishes after its URL left the configuration updates neither cache nor error. On `loader/volatile-update` the service drops state of removed URLs and emits `plugin-market/changed`. Disposal aborts in-flight fetches.
|
||||
|
||||
@@ -95,7 +101,7 @@ Filtering and ordering read only the document; installation status and compatibi
|
||||
|
||||
Compatibility is computed per version with `evaluatePluginCompatibility`, the version's `engines.dsh`, and the profile's version exemptions, the same check installation applies. A plugin's default version is its highest compatible version without a prerelease tag, or its highest compatible prerelease when it lists no version without one; a plugin with no compatible version has none. Installation status comes from `pluginManager.listBundles()` by package name, measured against the default version, or the highest version without one: `not-installed`, also for an on-demand catalog entry the profile has not installed; `installed` at that version; `update-available` when that version is greater; `different-version` when the installed version is unknown, not valid SemVer, or greater; and `provided` for a bundle the DSH installation ships. A version's `update` is true when it is newer than a copy `listBundles` marks `update: 'git'` and pins a commit of the repository and directory that copy pins, so the Plugins page can replace that copy with it through `pluginManager.updateBundle`; a registry copy's newer versions come from its registry instead.
|
||||
|
||||
Entry detail reads share one reader that the service owns; document selection and the npm file CDNs come from [`dsh-plugin-detail`](../../util/plugin-detail/README.md). Each partial clone is a bare repository under `detailCacheDir`, named by a hash of its URL, initialized in a staging directory and renamed into place, and fetched with `--depth 1 --filter=blob:none` so only commits and trees arrive; Git downloads a file's contents when it is read. Commands run without inherited `GIT_*` variables other than the ssh program, with hooks, the file-system monitor, submodule recursion, and every transport but https, http, and ssh disabled, and no working tree is created. The directory size is checked every 200 ms while Git downloads; growth past `detailRepositoryMaxBytes` within one command stops Git, and output keeps a file's final newline byte. A file read stops once its contents pass the read's limit, and an image read completes even when the browser abandons the request, so leaving a page never interrupts a clone. A ref under `refs/dsh/` records each fetched commit, so a commit is never fetched lazily without the size check. Operations on one repository run one at a time, also across processes that share `detailCacheDir`, such as Web and Desktop on one profile, through a lock file beside the repository; eviction deletes a repository only after them, enforces `detailCacheMaxBytes` after every fetch and every file read, and deletes the repository in use last, after its operation, when it alone exceeds the total; one that fails or is cancelled, for any reason but a file over its read's limit, deletes the repository, so the next read starts from a fresh clone. Eviction also removes staging directories older than `detailGitTimeoutMs`. Disposal stops Git and waits for it.
|
||||
Entry detail reads share one reader that the service owns; document selection and the npm file CDNs come from [`dsh-plugin-detail`](../../util/plugin-detail/README.md). Each partial clone is a bare repository under `detailCacheDir`, named by a hash of its URL, initialized in a staging directory and renamed into place, and fetched with `--depth 1 --filter=blob:none` so only commits and trees arrive; Git downloads a file's contents when it is read. Commands run without inherited `GIT_*` variables other than the ssh program, with hooks, the file-system monitor, submodule recursion, and every transport but https, http, and ssh disabled, and no working tree is created. The directory size is checked every 200 ms while Git downloads; growth past `detailRepositoryMaxBytes` within one command stops Git, and output keeps a file's final newline byte. A file read stops once its contents pass the read's limit, and an image read completes even when the browser abandons the request, so leaving a page never interrupts a clone. A ref under `refs/dsh/` records each fetched commit, so a commit is never fetched lazily without the size check. Operations on one repository run one at a time, also across processes that share `detailCacheDir`, such as Web and Desktop on one profile, through a lock file beside the repository; eviction deletes a repository only after them, enforces `detailCacheMaxBytes` after every fetch and every file read, and deletes the repository in use last, after its operation, when it alone exceeds the total; a read that fails or is cancelled while holding the lock deletes the repository unless the file exceeds its read limit, so the next read starts from a fresh clone. Eviction also removes staging directories older than `detailGitTimeoutMs`. Disposal stops Git and waits for it.
|
||||
|
||||
`marketInstallTarget` builds install arguments: `name@version` with the version's registry for npm, and `git+<url>.git#<commit>` with `&path:/<path>` for a package directory in Git.
|
||||
|
||||
@@ -122,10 +128,11 @@ Append-only: results enter the conversation as ordinary tool results and do not
|
||||
|
||||
<a id="known-limitations-and-deferred-work"></a>
|
||||
|
||||
- **Git index icons** — use a base64 data URL or an absolute HTTPS URL that the browser can reach. Git credentials apply to the index file.
|
||||
- **Git updates only** — only a copy installed from a Git commit updates to a newer index version, and only within the repository directory it came from; a copy installed from a registry updates from its registry, and one installed from another source, such as a local directory, a branch, or another repository, is uninstalled and installed again.
|
||||
- **Unsigned indexes** — index content, including a Git entry's name and version, is the index's claim; the installed manifest decides what is installed.
|
||||
- **Last write wins** — `setIndexes` replaces the whole list, so two windows editing sources at the same time can overwrite each other's change.
|
||||
- **Redirects refused** — an index served only behind a redirect must be configured at its final URL.
|
||||
- **Direct JSON redirects** — a direct JSON index served only behind a redirect must be configured at its final URL.
|
||||
- **Whole-document reads** — the Host downloads and keeps each index up to `maxBytes` and builds its text index in memory; a synthetic index of 20,000 plugins took about 0.8 s of build time and 130 MiB of heap. Parsing runs in a Worker, but receiving the validated index still blocks the Host event loop while the clone is deserialized: about 35 ms for a synthetic 7.6 MiB index of 20,000 plugins and about 190 ms for 38 MiB and 100,000 plugins. Larger indexes need a server-side query protocol.
|
||||
- **Default-branch READMEs** — a repository README is read at the default branch, which can differ from the listed version; npm records no commit the CDNs expose.
|
||||
- **Private npm registries** — the public CDNs do not serve packages of other registries, so only the entry's repository can provide such a version's document.
|
||||
|
||||
@@ -28,20 +28,24 @@ kind: "package-reference"
|
||||
|
||||
| 配置 | 默认值 | 含义 |
|
||||
|---|---|---|
|
||||
| `indexes` | `[]` | 按显示顺序排列的索引 URL。可用的 URL 采用规范形式,使用 `http:` 或 `https:`,不含凭据或片段。该字段是 volatile 字段:发现区、设置和 `setIndexes` 修改它时,不会重新挂载本服务或 `plugin-manager`。 |
|
||||
| `fetchTimeoutMs` | `15000` | 单次索引获取(包括响应体)的时限。 |
|
||||
| `maxBytes` | `134217728` | 接受的最大索引响应体。 |
|
||||
| `indexes` | `[]` | 按显示顺序排列的规范索引源 URL。发现区、设置和 `setIndexes` 可修改此字段,无需重新挂载本服务或 `plugin-manager`。 |
|
||||
| `fetchTimeoutMs` | `15000` | 单次通过 HTTP(S) 请求索引或详细介绍文件的时限,包括读取响应体。 |
|
||||
| `maxBytes` | `134217728` | 接受的最大索引文件大小。 |
|
||||
| `cacheTtlMs` | `600000` | 成功读取的索引文档、详细介绍的读取结果以及仓库默认分支提交的缓存时长。 |
|
||||
| `detailMaxBytes` | `1048576` | 详细介绍文档的最大大小,以及为读取它而读取的 locale 文件的最大大小。 |
|
||||
| `detailImageMaxBytes` | `5242880` | 与详细介绍文档一同提供的图片的最大大小。 |
|
||||
| `detailRepositoryMaxBytes` | `52428800` | 单条 Git 命令向一个部分克隆增加的最大数据量;获取时增加的数据量超过该值的仓库不被读取。 |
|
||||
| `detailCacheMaxBytes` | `524288000` | 所有部分克隆的最大总大小;每次获取后,超出时删除最近最少使用的部分克隆。 |
|
||||
| `detailCacheDir` | `.plugin-market/repositories` | 部分克隆所在的目录,相对于 profile 目录;服务在 dsh profile 之外运行时必须以绝对路径配置。 |
|
||||
| `detailGitTimeoutMs` | `60000` | 克隆回退方式中单条 Git 命令的时限。 |
|
||||
| `detailGitTimeoutMs` | `60000` | 通过 Git 完整读取索引文件的时限(含排队和等待锁),以及读取索引或详细介绍文件时单条 Git 命令的时限。 |
|
||||
| `detailNpmFileSources` | `['jsdelivr', 'unpkg', 'npmmirror']` | 按顺序读取的 npm 文件 CDN;一次读取的 `npmFileSources` 把其中列出的 CDN 移到最前,本列表未列出的 CDN 不会被请求。 |
|
||||
| `detailGitlabHosts` | `['gitlab.com']` | 通过 GitLab 仓库文件 API 提供公开仓库的主机,比较时不区分大小写。 |
|
||||
|
||||
设置和 profile 文件可以存储任意 http(s) 字符串,因此服务在列出或读取每个 URL 时校验它。`listIndexes` 报告不可用的 URL 及其拒绝原因,`search` 和 `entry` 拒绝该 URL,且不会向它发送请求;重复的 URL 只列出一次。
|
||||
索引源可以是直接返回 JSON 的地址,例如 `https://example.com/index.json`,也可以是 Git 仓库,例如 `git+https://github.com/acme/plugins.git` 或 `git+ssh://[email protected]/platform/plugins.git`。直接返回 JSON 的地址使用 HTTP 或 HTTPS,且不含凭据或片段。Git 源读取默认分支上仓库根目录的 `index.json`。添加 `?path=market%2Findex.json&ref=main` 可指定相对于仓库根目录的其他路径或引用。引用可以是分支名或完整的小写 SHA-1 提交 ID。
|
||||
|
||||
通过 HTTPS 读取时,Git 使用运行 DSH Host 的用户配置的 Git 凭据助手。通过 SSH 读取时,Git 使用该用户的 SSH 配置和密钥。添加私有索引前,请先在运行 Host 的机器上配置访问权限。Git 的 `url.<base>.insteadOf` 规则可将仓库地址改写为另一个 HTTPS 或 SSH 地址。如果所选地址连接失败,Host 会报告错误,你可以修正索引源或 Host 的 Git 访问设置。
|
||||
|
||||
服务在列出或读取索引源时校验地址。`listIndexes` 报告不可用的 URL 及其拒绝原因,`search` 和 `entry` 拒绝访问该 URL。重复的 URL 只列出一次。
|
||||
|
||||
Remote 方法如下:
|
||||
|
||||
@@ -88,7 +92,9 @@ Remote 方法如下:
|
||||
<a id="understand-the-implementation"></a>
|
||||
## 理解实现
|
||||
|
||||
Host 使用进程的 `fetch` 获取,因此配置的出站代理生效,并拒绝重定向。响应体最多读取 `maxBytes`,随后由一个新的 Worker Thread 按严格 UTF-8 解码、解析为 JSON 并校验;相对图标引用基于配置的 URL 解析。响应体的缓冲区转移给 Worker,校验后的索引通过 structured clone 返回 Host。Worker 是自包含的 `lib/worker.cjs` bundle;销毁时终止它,Worker 失败报告为 `plugin-market/fetch-failed`。
|
||||
Host 使用进程的 `fetch` 读取直接返回 JSON 的地址,因此配置的出站代理生效。这类地址不接受重定向。对于 Git 源,Host 从与详细介绍分开缓存的部分克隆中读取索引。Git 读取默认拒绝 HTTPS 重定向,且不会换用另一个远端重试。重新读取索引时会再次获取默认分支或指定的分支,已缓存的固定提交则会复用。
|
||||
|
||||
索引最多读取 `maxBytes`。新的 Worker Thread 按严格 UTF-8 解码文件内容,将其解析为 JSON 并校验结果。直接返回 JSON 的源以其 URL 为基准解析相对图标引用。缓冲区转移给 Worker,校验后的索引通过 structured clone 返回 Host。销毁时终止自包含的 `lib/worker.cjs` Worker。Worker 失败报告为 `plugin-market/fetch-failed`。
|
||||
|
||||
对同一 URL 的并发读取共享一次获取。成功的文档缓存 `cacheTtlMs`;`refresh` 绕过缓存。每份获取到的文档都有新的 `fetchedAt`,缓存的文档在被之后的获取替换前,都可以按其 `fetchedAt` 回答。失败的读取为 `listIndexes` 记录错误消息,不保留文档。读取完成时其 URL 已不在配置中的,既不更新缓存也不更新错误。收到 `loader/volatile-update` 时,服务丢弃已移除 URL 的状态并发出 `plugin-market/changed`。销毁时中止进行中的获取。
|
||||
|
||||
@@ -96,7 +102,7 @@ Host 使用进程的 `fetch` 获取,因此配置的出站代理生效,并拒
|
||||
|
||||
兼容性按版本计算:使用 `evaluatePluginCompatibility`,传入该版本的 `engines.dsh` 和 profile 的版本豁免,与安装时执行的检查相同。插件的默认版本是其不带先行版本号的最高兼容版本;插件完全没有此类版本时,使用其最高兼容的先行版本;没有兼容版本的插件没有默认版本。安装状态按包名根据 `pluginManager.listBundles()` 计算,以默认版本为准,没有默认版本时以最高版本为准:`not-installed`(包括当前 profile 尚未安装的按需目录条目);版本相同时为 `installed`;该版本更高时为 `update-available`;已安装版本未知、不是有效的 SemVer 或更高时为 `different-version`;DSH 安装随附的组合包(bundle)为 `provided`。版本比 `listBundles` 标为 `update: 'git'` 的副本新,且固定到该副本所固定的仓库与目录中的一个提交时,其 `update` 为 true,插件页因此可以通过 `pluginManager.updateBundle` 用它替换该副本;注册表副本的新版本则来自其注册表。
|
||||
|
||||
条目详细介绍的读取共用服务拥有的一个读取器;文档选择和 npm 文件 CDN 来自 [`dsh-plugin-detail`](../../util/plugin-detail/README.zh.md)。每个部分克隆是 `detailCacheDir` 下的一个裸仓库,以其 URL 的哈希命名,先在暂存目录中初始化,再重命名到目标位置,并使用 `--depth 1 --filter=blob:none` 获取,因此只下载提交和树对象;读取文件时 Git 才下载其内容。命令运行时不继承除 ssh 程序之外的 `GIT_*` 变量,禁用 hook、文件系统监视器、子模块递归,以及 https、http 和 ssh 之外的所有传输协议,且不创建工作树。Git 下载期间每 200 毫秒检查一次目录大小;单条命令执行期间增长超过 `detailRepositoryMaxBytes` 时停止 Git,且输出保留文件末尾的换行字节。文件内容超过本次读取的限制时,读取即停止;浏览器放弃请求时,图片读取仍会完成,因此离开页面不会中断克隆。`refs/dsh/` 下的 ref 记录每个已获取的提交,因此不会在没有大小检查的情况下延迟获取提交。对同一仓库的操作逐个执行,共享 `detailCacheDir` 的多个进程(例如同一 profile 上的 Web 和 Desktop)之间也是如此,由仓库旁的一个锁文件实现;淘汰只在这些操作结束后删除该仓库,并在每次获取和每次文件读取后执行 `detailCacheMaxBytes` 总量限制;正在使用的仓库单独超过该总量时,淘汰最后删除它,并等到其操作结束后再删除;除文件超过本次读取的限制外,任何原因导致操作失败或被取消时,都删除该仓库,使下一次读取从新的克隆开始。淘汰时还会删除存在时间超过 `detailGitTimeoutMs` 的暂存目录。销毁时停止 Git 并等待其退出。
|
||||
条目详细介绍的读取共用服务拥有的一个读取器;文档选择和 npm 文件 CDN 来自 [`dsh-plugin-detail`](../../util/plugin-detail/README.zh.md)。每个部分克隆是 `detailCacheDir` 下的一个裸仓库,以其 URL 的哈希命名,先在暂存目录中初始化,再重命名到目标位置,并使用 `--depth 1 --filter=blob:none` 获取,因此只下载提交和树对象;读取文件时 Git 才下载其内容。命令运行时不继承除 ssh 程序之外的 `GIT_*` 变量,禁用 hook、文件系统监视器、子模块递归,以及 https、http 和 ssh 之外的所有传输协议,且不创建工作树。Git 下载期间每 200 毫秒检查一次目录大小;单条命令执行期间增长超过 `detailRepositoryMaxBytes` 时停止 Git,且输出保留文件末尾的换行字节。文件内容超过本次读取的限制时,读取即停止;浏览器放弃请求时,图片读取仍会完成,因此离开页面不会中断克隆。`refs/dsh/` 下的 ref 记录每个已获取的提交,因此不会在没有大小检查的情况下延迟获取提交。对同一仓库的操作逐个执行,共享 `detailCacheDir` 的多个进程(例如同一 profile 上的 Web 和 Desktop)之间也是如此,由仓库旁的一个锁文件实现;淘汰只在这些操作结束后删除该仓库,并在每次获取和每次文件读取后执行 `detailCacheMaxBytes` 总量限制;正在使用的仓库单独超过该总量时,淘汰最后删除它,并等到其操作结束后再删除;持锁读取失败或被取消时删除该仓库,文件超过本次读取限制时除外,使下一次读取从新的克隆开始。淘汰时还会删除存在时间超过 `detailGitTimeoutMs` 的暂存目录。销毁时停止 Git 并等待其退出。
|
||||
|
||||
`marketInstallTarget` 构建安装参数:npm 为 `name@version` 加该版本的 registry,Git 为 `git+<url>.git#<commit>`,包位于子目录时追加 `&path:/<path>`。
|
||||
|
||||
@@ -123,10 +129,11 @@ Host 使用进程的 `fetch` 获取,因此配置的出站代理生效,并拒
|
||||
|
||||
<a id="known-limitations-and-deferred-work"></a>
|
||||
|
||||
- **Git 索引图标**——使用 base64 数据 URL 或浏览器可访问的 HTTPS 绝对地址。Git 凭据用于读取索引文件。
|
||||
- **只支持 Git 更新**——只有从 Git 提交安装的副本会更新到索引中较新的版本,且只在其来源的仓库目录内更新;从注册表安装的副本从其注册表更新,从其他来源(例如本地目录、分支或其他仓库)安装的副本需要先卸载再安装。
|
||||
- **索引没有签名**——索引内容(包括 Git 条目的名称和版本)是索引的声明;实际安装什么由已安装的 manifest(元数据清单)决定。
|
||||
- **后写入者覆盖**——`setIndexes` 会替换整个列表,因此两个窗口同时编辑索引源时,可能互相覆盖对方的修改。
|
||||
- **拒绝重定向**——只能经重定向访问的索引必须以其最终 URL 配置。
|
||||
- **直接 JSON 地址的重定向**——只能经重定向访问的直接 JSON 索引必须以其最终 URL 配置。
|
||||
- **读取整份文档**——Host 下载并保留每个不超过 `maxBytes` 的索引,并在内存中构建其文本索引;一个包含 20,000 个插件的合成索引构建用时约 0.8 秒,占用约 130 MiB 堆内存。解析在 Worker 中运行,但接收校验后的索引时,反序列化 clone 仍会阻塞 Host 事件循环:包含 20,000 个插件的 7.6 MiB 合成索引约 35 毫秒,包含 100,000 个插件的 38 MiB 索引约 190 毫秒。更大的索引需要服务端查询协议。
|
||||
- **默认分支的 README**——仓库 README 读取的是默认分支上的文件,可能与列出的版本不一致;CDN 公开的 npm 数据不记录提交。
|
||||
- **私有 npm 注册表**——公共 CDN 不提供其他注册表的包,因此此类版本的文档只能来自条目的仓库。
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
/** Index source URL validation shared by `setIndexes` and the per-use check of configured sources. */
|
||||
import { parseGitMarketIndexSource } from '@deepseek-ai/dsh-plugin-market-index/source'
|
||||
import { RemoteError } from '@deepseek-ai/dsh-typert-protocol'
|
||||
|
||||
/**
|
||||
* Validate and normalize one index source URL.
|
||||
* @param text - URL as configured or entered.
|
||||
* @returns the URL's serialization.
|
||||
* @throws {RemoteError} `plugin-market/invalid-index-url` for anything but an http(s) URL without credentials or
|
||||
* fragment.
|
||||
* @throws {RemoteError} `plugin-market/invalid-index-url` for an invalid HTTP(S) or Git index address.
|
||||
*/
|
||||
export function normalizeIndexUrl(text: string): string {
|
||||
if (text.trimStart().startsWith('git+')) {
|
||||
try {
|
||||
return parseGitMarketIndexSource(text.trim()).url
|
||||
} catch (error) {
|
||||
const message = error instanceof Error && !(error instanceof TypeError) ? error.message : 'Use a valid Git repository address'
|
||||
throw new RemoteError('plugin-market/invalid-index-url', message, { url: '', reason: 'git-source' })
|
||||
}
|
||||
}
|
||||
let url: URL
|
||||
try {
|
||||
url = new URL(text.trim())
|
||||
|
||||
@@ -6,6 +6,7 @@ import z from '@deepseek-ai/schemastery'
|
||||
import semver from 'semver'
|
||||
import { evaluatePluginCompatibility, getDshRuntimeVersion } from '@deepseek-ai/dsh-app-boot'
|
||||
import { marketInstallTarget, type MarketIndex, type MarketPlugin, type MarketVersion } from '@deepseek-ai/dsh-plugin-market-index'
|
||||
import { parseGitMarketIndexSource } from '@deepseek-ai/dsh-plugin-market-index/source'
|
||||
import type { BundleInfo } from '@deepseek-ai/dsh-plugin-manager/types'
|
||||
// Also declares the `pluginManager` service this one reads bundles from.
|
||||
import { pinnedGitOrigin } from '@deepseek-ai/dsh-plugin-manager'
|
||||
@@ -44,7 +45,7 @@ declare module '@deepseek-ai/cordis' {
|
||||
export interface Config {
|
||||
/** Index URLs in display order; Settings and `setIndexes` write this field without remounting the service. */
|
||||
indexes: Volatile<string[]>
|
||||
/** Deadline for one index fetch, including the body. */
|
||||
/** Deadline for an HTTP index or detail file request, including its body. */
|
||||
fetchTimeoutMs: number
|
||||
/** Largest accepted index body in bytes. */
|
||||
maxBytes: number
|
||||
@@ -60,7 +61,7 @@ export interface Config {
|
||||
detailCacheMaxBytes: number
|
||||
/** Directory of the partial clones, relative to the profile directory; absent means `.plugin-market/repositories`. */
|
||||
detailCacheDir?: string
|
||||
/** Deadline of one Git command of the clone fallback. */
|
||||
/** Deadline for a Git index read and for each Git command used to read an index or plugin details. */
|
||||
detailGitTimeoutMs: number
|
||||
/** npm file CDNs read in order; a read's `npmFileSources` moves the CDNs it names first. */
|
||||
detailNpmFileSources: NpmFileSource[]
|
||||
@@ -110,7 +111,7 @@ export default class PluginMarket extends TypertRemoteService {
|
||||
static inject = ['pluginManager']
|
||||
|
||||
static Config = z.object({
|
||||
indexes: z.array(z.string().pattern(/^https?:\/\/\S+$/u)).default([]).volatile(),
|
||||
indexes: z.array(z.string().pattern(/^(?:https?|git\+(?:https|ssh)):\/\/\S+$/u)).default([]).volatile(),
|
||||
fetchTimeoutMs: z.natural().min(1).max(MAX_TIMER_DELAY_MS).default(15000),
|
||||
maxBytes: z.natural().min(1).default(128 * 1024 * 1024),
|
||||
cacheTtlMs: z.natural().default(600000),
|
||||
@@ -381,7 +382,7 @@ export default class PluginMarket extends TypertRemoteService {
|
||||
|
||||
/**
|
||||
* The configured sources as written, each with the refusal that makes it unusable. Settings and profile files can
|
||||
* write any http(s) string, so every use validates instead of the schema; an unusable source is listed with its error
|
||||
* write a noncanonical address, so every use validates it. An unusable source is listed with its error
|
||||
* and never fetched, and a repeated URL counts once.
|
||||
*/
|
||||
private sources(): { readonly url: string; readonly error?: string }[] {
|
||||
@@ -423,9 +424,44 @@ export default class PluginMarket extends TypertRemoteService {
|
||||
}
|
||||
|
||||
private async fetchIndex(url: string): Promise<MarketIndex> {
|
||||
const signal = AbortSignal.any([this.lifetime.signal, AbortSignal.timeout(this.config.fetchTimeoutMs)])
|
||||
const git = url.startsWith('git+')
|
||||
const timeoutMs = git ? this.config.detailGitTimeoutMs : this.config.fetchTimeoutMs
|
||||
const signal = AbortSignal.any([this.lifetime.signal, AbortSignal.timeout(timeoutMs)])
|
||||
const failed = (reason: string, cause?: unknown): RemoteError =>
|
||||
new RemoteError('plugin-market/fetch-failed', `Could not fetch ${url}: ${reason}`, { url, reason }, { cause })
|
||||
const bytes = git ? await this.readGitIndex(url, signal, failed) : await this.fetchIndexBody(url, signal, failed)
|
||||
const result = await parseIndexInWorker(bytes, url, this.lifetime.signal).catch((error: unknown) => {
|
||||
throw failed(messageOf(error), error)
|
||||
})
|
||||
if (result.ok) return result.index
|
||||
throw new RemoteError('plugin-market/invalid-index', `${url}: ${result.message}`, { url, path: result.path, reason: result.reason })
|
||||
}
|
||||
|
||||
private async readGitIndex(url: string, signal: AbortSignal, failed: (reason: string) => RemoteError): Promise<Uint8Array> {
|
||||
const { repository, ref, path } = parseGitMarketIndexSource(url)
|
||||
let bytes: Uint8Array | undefined
|
||||
try {
|
||||
bytes = await this.repositories.readIndex(repository, ref, path, this.config.maxBytes, signal)
|
||||
} catch (error) {
|
||||
if (signal.aborted) throw failed(messageOf(signal.reason))
|
||||
if (error instanceof DetailFailure) {
|
||||
switch (error.reason) {
|
||||
case 'denied': throw failed('Git could not read the repository. Check Host Git authentication, repository permissions, and the branch or commit')
|
||||
case 'git-unavailable': throw failed('Git is unavailable on the Host')
|
||||
case 'network': throw failed('Git could not connect to the repository')
|
||||
case 'too-large': throw failed('The Git index file or repository exceeds its size limit')
|
||||
default: break
|
||||
}
|
||||
}
|
||||
throw failed('Git could not read the index file on the Host')
|
||||
}
|
||||
if (bytes === undefined) throw failed(`No regular index file at ${path}`)
|
||||
return Uint8Array.from(bytes)
|
||||
}
|
||||
|
||||
private async fetchIndexBody(
|
||||
url: string, signal: AbortSignal, failed: (reason: string, cause?: unknown) => RemoteError,
|
||||
): Promise<Uint8Array> {
|
||||
let response: Response
|
||||
try {
|
||||
response = await fetch(url, { signal, redirect: 'error', headers: { accept: 'application/json' } })
|
||||
@@ -436,12 +472,7 @@ export default class PluginMarket extends TypertRemoteService {
|
||||
await response.body?.cancel()
|
||||
throw failed(`HTTP ${String(response.status)}`)
|
||||
}
|
||||
const bytes = await this.readBody(response, failed)
|
||||
const result = await parseIndexInWorker(bytes, url, this.lifetime.signal).catch((error: unknown) => {
|
||||
throw failed(messageOf(error), error)
|
||||
})
|
||||
if (result.ok) return result.index
|
||||
throw new RemoteError('plugin-market/invalid-index', `${url}: ${result.message}`, { url, path: result.path, reason: result.reason })
|
||||
return await this.readBody(response, failed)
|
||||
}
|
||||
|
||||
/** Read the whole body, refusing it as soon as it exceeds `maxBytes`. */
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* Cached partial clones for plugin detail documents of repositories that need the user's Git credentials or have no
|
||||
* anonymous single-file API. Each repository is a bare repository fetched with depth 1 and without file contents; Git
|
||||
* downloads a file's contents only when it is read. No working tree is created, so no checkout filter, hook, LFS
|
||||
* download, or symbolic link takes effect. A repository whose operation fails or is cancelled is deleted, so an
|
||||
* interrupted command never leaves a damaged clone behind.
|
||||
* Cached partial clones for Git market indexes and plugin detail documents. Each repository is a bare repository
|
||||
* fetched with depth 1 and without file contents. Git downloads a file's contents when it is read. No working tree
|
||||
* is created, so no checkout filter, hook, LFS download, or symbolic link takes effect. Once a read starts under the
|
||||
* lock, failure or cancellation deletes the repository, except when an individual file exceeds its read limit.
|
||||
*/
|
||||
import { createHash } from 'node:crypto'
|
||||
import { addAbortListener } from 'node:events'
|
||||
import { existsSync } from 'node:fs'
|
||||
import { mkdir, mkdtemp, readdir, rename, rm, stat, utimes } from 'node:fs/promises'
|
||||
import { join } from 'node:path'
|
||||
@@ -22,7 +22,7 @@ const OPERATION_COMMANDS = 5
|
||||
|
||||
/** Limits, location, and transports of the clone cache. */
|
||||
export interface RepositoryCacheOptions {
|
||||
/** Directory holding one bare repository per repository URL. */
|
||||
/** Directory holding bare repositories keyed by repository URL and read policy. */
|
||||
readonly dir: string
|
||||
/** Largest amount one command adds to a repository; a command that adds more is stopped and the repository deleted. */
|
||||
readonly maxRepositoryBytes: number
|
||||
@@ -30,9 +30,9 @@ export interface RepositoryCacheOptions {
|
||||
readonly maxCacheBytes: number
|
||||
/** Deadline of one Git command and of one anonymous accessibility check. */
|
||||
readonly timeoutMs: number
|
||||
/** How long a repository's default-branch commit and its anonymous accessibility are reused. */
|
||||
/** How long a detail repository's default-branch commit and anonymous accessibility are reused. */
|
||||
readonly ttlMs: number
|
||||
/** Git transports Git may use, such as `https` and `ssh`; `url.<base>.insteadOf` in the user's configuration still applies. */
|
||||
/** Transports allowed for detail reads. Index reads allow HTTPS and SSH. Git URL rewrites still apply. */
|
||||
readonly transports: readonly string[]
|
||||
/** Disposal of the owning service. */
|
||||
readonly lifetime: AbortSignal
|
||||
@@ -45,6 +45,19 @@ const NETWORK_FAILURE = new RegExp([
|
||||
'Could not resolve host', 'Failed to connect', 'Connection (?:refused|reset)', 'timed out', 'Network is unreachable', 'SSL', 'TLS',
|
||||
].join('|'), 'iu')
|
||||
|
||||
interface GitDirectory {
|
||||
readonly dir: string
|
||||
readonly policy: 'detail' | 'index'
|
||||
}
|
||||
|
||||
interface CachedRepository extends GitDirectory {
|
||||
readonly url: string
|
||||
}
|
||||
|
||||
type GitRef = { readonly kind: 'head' }
|
||||
| { readonly kind: 'branch'; readonly name: string }
|
||||
| { readonly kind: 'commit'; readonly id: string }
|
||||
|
||||
/** One Git command's outcome. */
|
||||
interface GitResult {
|
||||
readonly stdout: Buffer
|
||||
@@ -112,7 +125,16 @@ function gitEnv(): Record<string, string> {
|
||||
}
|
||||
}
|
||||
|
||||
/** Partial clones of detail repositories under one directory, owned by one service. */
|
||||
/** Wait for the previous operation without making it responsible for this read's deadline. */
|
||||
async function waitForTurn(previous: Promise<void>, signal: AbortSignal): Promise<void> {
|
||||
signal.throwIfAborted()
|
||||
const aborted = Promise.withResolvers<void>()
|
||||
using _listener = addAbortListener(signal, () => { aborted.resolve() })
|
||||
await Promise.race([previous, aborted.promise])
|
||||
signal.throwIfAborted()
|
||||
}
|
||||
|
||||
/** Partial clones of index and detail repositories under one size budget, owned by one service. */
|
||||
export class RepositoryCache {
|
||||
private readonly locks = new Map<string, Promise<void>>()
|
||||
private readonly heads = new Map<string, Expiring<string>>()
|
||||
@@ -175,10 +197,33 @@ export class RepositoryCache {
|
||||
* @throws {DetailFailure} when Git cannot fetch the commit, the repository grows past its limit, or the file exceeds `maxBytes`.
|
||||
*/
|
||||
read(url: string, commit: string | undefined, path: string, maxBytes: number, signal: AbortSignal): Promise<Uint8Array | undefined> {
|
||||
return this.locked(url, async (repository) => {
|
||||
const resolved = await this.commit(repository, url, commit, signal)
|
||||
return this.readFile(url, 'detail', commit === undefined ? { kind: 'head' } : { kind: 'commit', id: commit }, path, maxBytes, signal)
|
||||
}
|
||||
|
||||
/**
|
||||
* Read an index file from a clone isolated from detail reads. A branch or remote HEAD is fetched on every call.
|
||||
* The read defaults to rejecting HTTPS redirects and does not retry with another remote.
|
||||
* @param url - the validated HTTPS or SSH repository URL. Git URL rewrites between those transports apply.
|
||||
* @param ref - a validated branch name, full lower-case SHA-1 commit id, or undefined for remote HEAD.
|
||||
* @param path - `/`-separated path relative to the repository root.
|
||||
* @param maxBytes - largest accepted index size.
|
||||
* @param signal - cancellation of the read, including waits for the repository lock.
|
||||
* @returns the bytes, or undefined if the resolved commit has no regular file at `path`.
|
||||
* @throws {DetailFailure} as {@link read} does.
|
||||
*/
|
||||
readIndex(url: string, ref: string | undefined, path: string, maxBytes: number, signal: AbortSignal): Promise<Uint8Array | undefined> {
|
||||
const target: GitRef = ref === undefined ? { kind: 'head' }
|
||||
: /^[0-9a-f]{40}$/u.test(ref) ? { kind: 'commit', id: ref } : { kind: 'branch', name: ref }
|
||||
return this.readFile(url, 'index', target, path, maxBytes, signal)
|
||||
}
|
||||
|
||||
private readFile(
|
||||
url: string, policy: GitDirectory['policy'], ref: GitRef, path: string, maxBytes: number, signal: AbortSignal,
|
||||
): Promise<Uint8Array | undefined> {
|
||||
return this.locked(url, policy, signal, async (repository) => {
|
||||
const resolved = await this.commit(repository, ref, signal)
|
||||
const blob = (await this.files(repository, resolved, path, signal)).get(path)
|
||||
return blob === undefined ? undefined : await this.blob(repository, url, blob, path, maxBytes, signal)
|
||||
return blob === undefined ? undefined : await this.blob(repository, blob, path, maxBytes, signal)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -193,30 +238,34 @@ export class RepositoryCache {
|
||||
* @throws {DetailFailure} as {@link read} does.
|
||||
*/
|
||||
readme(url: string, commit: string | undefined, dir: string, maxBytes: number, signal: AbortSignal): Promise<FoundFile | undefined> {
|
||||
return this.locked(url, async (repository) => {
|
||||
const resolved = await this.commit(repository, url, commit, signal)
|
||||
return this.locked(url, 'detail', signal, async (repository) => {
|
||||
const resolved = await this.commit(repository, commit === undefined ? { kind: 'head' } : { kind: 'commit', id: commit }, signal)
|
||||
const files = await this.files(repository, resolved, dir === '' ? undefined : `${dir}/`, signal)
|
||||
const prefix = dir === '' ? '' : `${dir}/`
|
||||
const name = readmeName([...files.keys()].map(path => path.slice(prefix.length)))
|
||||
if (name === undefined) return undefined
|
||||
const path = `${prefix}${name}`
|
||||
return { path, bytes: await this.blob(repository, url, files.get(path) as string, path, maxBytes, signal) }
|
||||
return { path, bytes: await this.blob(repository, files.get(path) as string, path, maxBytes, signal) }
|
||||
})
|
||||
}
|
||||
|
||||
/** Wait until every running Git command has ended; the lifetime signal stops them. */
|
||||
/** Wait for queued and running operations to settle and release their locks. */
|
||||
async settled(): Promise<void> {
|
||||
await Promise.allSettled([...this.running])
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize operations on one repository, so a fetch and the reads after it never interleave, and delete the
|
||||
* repository when an operation fails or is cancelled for any reason but a file over its read's size.
|
||||
* repository when a read holding the lock fails or is cancelled for any reason but a file over its read's size.
|
||||
*/
|
||||
private locked<T>(url: string, operation: (repository: string) => Promise<T>): Promise<T> {
|
||||
const repository = join(this.options.dir, createHash('sha256').update(url).digest('hex').slice(0, 24))
|
||||
return this.serialized(repository, () => operation(repository).catch(async (error: unknown) => {
|
||||
if (!(error instanceof FileTooLarge)) await rm(repository, { recursive: true, force: true })
|
||||
private locked<T>(
|
||||
url: string, policy: GitDirectory['policy'], signal: AbortSignal, operation: (repository: CachedRepository) => Promise<T>,
|
||||
): Promise<T> {
|
||||
const key = policy === 'detail' ? url : `index\0${url}`
|
||||
const dir = join(this.options.dir, createHash('sha256').update(key).digest('hex').slice(0, 24))
|
||||
const cancellation = AbortSignal.any([signal, this.options.lifetime])
|
||||
return this.serialized(dir, cancellation, () => operation({ dir, url, policy }).catch(async (error: unknown) => {
|
||||
if (!(error instanceof FileTooLarge)) await rm(dir, { recursive: true, force: true })
|
||||
throw error
|
||||
}))
|
||||
}
|
||||
@@ -225,16 +274,16 @@ export class RepositoryCache {
|
||||
* Run an operation after every earlier operation on the same repository directory has ended, in this service and in
|
||||
* other processes that share the cache directory, such as Web and Desktop on one profile.
|
||||
*/
|
||||
private serialized<T>(repository: string, operation: () => Promise<T>): Promise<T> {
|
||||
private serialized<T>(repository: string, signal: AbortSignal, operation: () => Promise<T>): Promise<T> {
|
||||
const previous = this.locks.get(repository) ?? Promise.resolve()
|
||||
const next = previous.then(async () => {
|
||||
const next = waitForTurn(previous, signal).then(async () => {
|
||||
await mkdir(this.options.dir, { recursive: true })
|
||||
// An operation runs at most this many Git commands, each bounded by the Git deadline.
|
||||
const waitMs = OPERATION_COMMANDS * this.options.timeoutMs
|
||||
return await withFileLock(repository, operation, { waitMs, signal: this.options.lifetime })
|
||||
return await withFileLock(repository, operation, { waitMs, signal })
|
||||
})
|
||||
// The caller receives the outcome; the lock and the settlement wait only for completion.
|
||||
const tracked: Promise<void> = next.then(() => undefined, () => undefined).finally(() => {
|
||||
// A cancelled waiter can settle before its predecessor. The queue still belongs to that predecessor.
|
||||
const tracked = next.then(() => previous, () => previous).finally(() => {
|
||||
if (this.locks.get(repository) === tracked) this.locks.delete(repository)
|
||||
this.running.delete(tracked)
|
||||
})
|
||||
@@ -243,54 +292,56 @@ export class RepositoryCache {
|
||||
return next
|
||||
}
|
||||
|
||||
/** The commit to read: a fetched commit, fetching it or the default branch when necessary. */
|
||||
private async commit(repository: string, url: string, commit: string | undefined, signal: AbortSignal): Promise<string> {
|
||||
/** Resolve and record a commit before reads that could download missing objects. */
|
||||
private async commit(repository: CachedRepository, ref: GitRef, signal: AbortSignal): Promise<string> {
|
||||
const { dir, url, policy } = repository
|
||||
if (!this.gitStarts) {
|
||||
// `git version <release>` is one short line.
|
||||
await this.run(this.options.dir, ['--version'], signal, 1024).catch((error: unknown) => {
|
||||
await this.run({ dir: this.options.dir, policy }, ['--version'], signal, 1024).catch((error: unknown) => {
|
||||
throw new DetailFailure('git-unavailable', (error as Error).message, { cause: error })
|
||||
})
|
||||
this.gitStarts = true
|
||||
}
|
||||
if (!existsSync(repository)) {
|
||||
if (!existsSync(dir)) {
|
||||
// A repository appears complete or not at all: it is initialized beside its final name, then renamed.
|
||||
const staging = await mkdtemp(join(this.options.dir, STAGING_PREFIX))
|
||||
const staging = { dir: await mkdtemp(join(this.options.dir, STAGING_PREFIX)), policy }
|
||||
try {
|
||||
await this.run(staging, ['init', '--quiet', '--bare', '--template='], signal)
|
||||
for (const [key, value] of [['remote.origin.url', url], ['remote.origin.promisor', 'true'], ['remote.origin.partialclonefilter', 'blob:none']]) {
|
||||
await this.run(staging, ['config', key as string, value as string], signal)
|
||||
}
|
||||
await rename(staging, repository)
|
||||
await rename(staging.dir, dir)
|
||||
} finally {
|
||||
await rm(staging, { recursive: true, force: true })
|
||||
await rm(staging.dir, { recursive: true, force: true })
|
||||
}
|
||||
}
|
||||
await utimes(repository, new Date(), new Date())
|
||||
await utimes(dir, new Date(), new Date())
|
||||
// An object lookup would fetch a missing commit lazily from the promisor remote, without the size watch; a ref
|
||||
// written after a completed fetch records the commit instead, and eviction removes it with the repository.
|
||||
const head = this.heads.get(url)
|
||||
const detailHead = policy === 'detail' && ref.kind === 'head'
|
||||
const head = detailHead ? this.heads.get(url) : undefined
|
||||
const commit = ref.kind === 'commit' ? ref.id : undefined
|
||||
const known = commit ?? (head !== undefined && head.expiresAt > Date.now() ? head.value : undefined)
|
||||
if (known !== undefined && !(await this.git(['show-ref', '--verify', '--quiet', `refs/dsh/${known}`], repository, signal)).failed) return known
|
||||
await this.fetch(repository, commit ?? 'HEAD', signal)
|
||||
if (known !== undefined && !(await this.git(repository, ['show-ref', '--verify', '--quiet', `refs/dsh/${known}`], signal)).failed) return known
|
||||
await this.fetch(repository, ref.kind === 'branch' ? `refs/heads/${ref.name}` : commit ?? 'HEAD', signal)
|
||||
const fetched = commit ?? (await this.run(repository, ['rev-parse', 'FETCH_HEAD'], signal)).toString('utf8').trim()
|
||||
await this.run(repository, ['update-ref', `refs/dsh/${fetched}`, fetched], signal)
|
||||
if (commit === undefined) this.heads.set(url, { value: fetched, expiresAt: Date.now() + this.options.ttlMs })
|
||||
if (detailHead) this.heads.set(url, { value: fetched, expiresAt: Date.now() + this.options.ttlMs })
|
||||
return fetched
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch one commit without file contents. When Git refuses an http(s) URL, the clone's remote switches to the SSH form
|
||||
* of that URL and the fetch runs again, so a user with only SSH credentials for the host can read it; later reads of
|
||||
* the clone keep that remote. A failed SSH fetch reports both diagnostics, as `network` or `too-large` when it failed
|
||||
* for that reason and as `denied` otherwise.
|
||||
* Fetch one commit without file contents. A detail clone that Git refuses over HTTP(S) retries and retains the SSH
|
||||
* form of its remote. A failed SSH retry reports both failures unless the repository exceeded its size limit.
|
||||
*/
|
||||
private async fetch(repository: string, target: string, signal: AbortSignal): Promise<void> {
|
||||
const args = ['fetch', '--quiet', '--depth', '1', '--filter=blob:none', '--no-tags', 'origin', target]
|
||||
private async fetch(repository: CachedRepository, target: string, signal: AbortSignal): Promise<void> {
|
||||
const args = ['fetch', '--quiet', '--depth', '1', '--filter=blob:none', '--no-tags', '--', 'origin', target]
|
||||
// The remote is the URL this cache wrote or its SSH form; 64 KiB holds any such URL.
|
||||
const remote = (await this.run(repository, ['config', 'remote.origin.url'], signal, 64 * 1024)).toString('utf8').trim()
|
||||
try {
|
||||
await this.watched(repository, remote, args, signal, `${remote}: git fetch`)
|
||||
} catch (error) {
|
||||
if (repository.policy === 'index') throw error
|
||||
const ssh = sshUrlOf(remote)
|
||||
if (ssh === undefined || !(error instanceof DetailFailure) || error.reason !== 'denied') throw error
|
||||
await this.run(repository, ['config', 'remote.origin.url', ssh], signal)
|
||||
@@ -300,7 +351,7 @@ export class RepositoryCache {
|
||||
: sshError
|
||||
})
|
||||
}
|
||||
await this.evict(repository)
|
||||
await this.evict(repository.dir)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -308,24 +359,24 @@ export class RepositoryCache {
|
||||
* command; the caller's lock then deletes the repository.
|
||||
*/
|
||||
private async watched(
|
||||
repository: string, url: string, args: readonly string[], signal: AbortSignal, label: string,
|
||||
repository: CachedRepository, url: string, args: readonly string[], signal: AbortSignal, label: string,
|
||||
maxBuffer = this.options.maxRepositoryBytes,
|
||||
): Promise<GitResult> {
|
||||
const limit = this.options.maxRepositoryBytes
|
||||
// The limit applies to what one command adds, so a clone that earlier reads filled stays usable.
|
||||
const before = await sizeOf(repository)
|
||||
const before = await sizeOf(repository.dir)
|
||||
const oversized = new AbortController()
|
||||
const timer = setInterval(() => {
|
||||
void sizeOf(repository).then((size) => { if (size - before > limit) oversized.abort() }, /* v8 ignore next -- Git renamed or
|
||||
void sizeOf(repository.dir).then((size) => { if (size - before > limit) oversized.abort() }, /* v8 ignore next -- Git renamed or
|
||||
deleted a file during the walk, which no test can time; the next tick measures again */ (_racing: unknown) => {})
|
||||
}, this.options.sizePollMs)
|
||||
let result: GitResult
|
||||
try {
|
||||
result = await this.git(args, repository, signal, oversized.signal, maxBuffer)
|
||||
result = await this.git(repository, args, signal, oversized.signal, maxBuffer)
|
||||
} finally {
|
||||
clearInterval(timer)
|
||||
}
|
||||
if (oversized.signal.aborted || (!result.failed && await sizeOf(repository) - before > limit)) {
|
||||
if (oversized.signal.aborted || (!result.failed && await sizeOf(repository.dir) - before > limit)) {
|
||||
throw new DetailFailure('too-large', `${url}: one fetch adds more than ${String(limit)} bytes`)
|
||||
}
|
||||
if (result.failed && !result.overflowed) throw remoteFailureOf(result, label)
|
||||
@@ -357,9 +408,8 @@ export class RepositoryCache {
|
||||
// The repository in use goes last: it is deleted only when it alone exceeds the cache, after its operation ends.
|
||||
for (const entry of entries.sort((a, b) => Number(a.path === kept) - Number(b.path === kept) || a.used - b.used)) {
|
||||
if (total <= this.options.maxCacheBytes) return
|
||||
void this.serialized(entry.path, () => rm(entry.path, { recursive: true, force: true })).catch(/* v8 ignore next -- a
|
||||
forced recursive delete fails only on file permissions no test sets; the repository stays and is measured again
|
||||
after the next fetch */ (_unremovable: unknown) => {})
|
||||
void this.serialized(entry.path, this.options.lifetime, () => rm(entry.path, { recursive: true, force: true }))
|
||||
.catch(/* v8 ignore next -- a failed eviction leaves the entry for the next size check */ (_error: unknown) => {})
|
||||
total -= entry.size
|
||||
}
|
||||
}
|
||||
@@ -368,7 +418,9 @@ export class RepositoryCache {
|
||||
* The regular files directly below a tree path, or the file at a path, with their blob ids; listing reads only trees,
|
||||
* so it fetches no file contents.
|
||||
*/
|
||||
private async files(repository: string, commit: string, path: string | undefined, signal: AbortSignal): Promise<Map<string, string>> {
|
||||
private async files(
|
||||
repository: CachedRepository, commit: string, path: string | undefined, signal: AbortSignal,
|
||||
): Promise<Map<string, string>> {
|
||||
const listing = (await this.run(repository, ['ls-tree', '-z', commit, ...path === undefined ? [] : ['--', path]], signal)).toString('utf8')
|
||||
const files = new Map<string, string>()
|
||||
for (const line of listing.split('\0')) {
|
||||
@@ -381,13 +433,13 @@ export class RepositoryCache {
|
||||
|
||||
/** Read a blob, fetching its contents under the repository size limit when the clone does not hold them yet. */
|
||||
private async blob(
|
||||
repository: string, url: string, blob: string, path: string, maxBytes: number, signal: AbortSignal,
|
||||
repository: CachedRepository, blob: string, path: string, maxBytes: number, signal: AbortSignal,
|
||||
): Promise<Uint8Array> {
|
||||
// The buffer stops Git once the contents pass `maxBytes`, so an oversized file never enters memory whole.
|
||||
const result = await this.watched(repository, url, ['cat-file', 'blob', blob], signal, `git cat-file ${path}`, maxBytes)
|
||||
const result = await this.watched(repository, repository.url, ['cat-file', 'blob', blob], signal, `git cat-file ${path}`, maxBytes)
|
||||
if (result.overflowed) throw new FileTooLarge(path, maxBytes)
|
||||
// Reading a blob can download it, so the cache total is enforced after every read as after every fetch.
|
||||
await this.evict(repository)
|
||||
await this.evict(repository.dir)
|
||||
return result.stdout
|
||||
}
|
||||
|
||||
@@ -395,8 +447,8 @@ export class RepositoryCache {
|
||||
* Run a Git command on local objects and return its output. A failure, such as a missing Git, a full disk, or a timeout,
|
||||
* is a plain error: it says nothing about the repository, so no read caches it.
|
||||
*/
|
||||
private async run(repository: string, args: readonly string[], signal: AbortSignal, maxBuffer?: number): Promise<Buffer> {
|
||||
const result = await this.git(args, repository, signal, undefined, maxBuffer)
|
||||
private async run(repository: GitDirectory, args: readonly string[], signal: AbortSignal, maxBuffer?: number): Promise<Buffer> {
|
||||
const result = await this.git(repository, args, signal, undefined, maxBuffer)
|
||||
if (result.failed) throw new Error(`git ${args[0] as string}: ${result.diagnostic}`)
|
||||
return result.stdout
|
||||
}
|
||||
@@ -406,16 +458,21 @@ export class RepositoryCache {
|
||||
* Cancellation by `signal` or the lifetime rejects with its reason; `stop` ends Git with a failed result.
|
||||
*/
|
||||
private async git(
|
||||
args: readonly string[], cwd: string, signal: AbortSignal, stop?: AbortSignal, maxBuffer = this.options.maxRepositoryBytes,
|
||||
{ dir, policy }: GitDirectory, args: readonly string[], signal: AbortSignal, stop?: AbortSignal,
|
||||
maxBuffer = this.options.maxRepositoryBytes,
|
||||
): Promise<GitResult> {
|
||||
const env = gitEnv()
|
||||
// The allowlist also applies after Git rewrites the URL and to lazy object downloads.
|
||||
if (policy === 'index') env.GIT_ALLOW_PROTOCOL = 'https:ssh'
|
||||
const safety = [
|
||||
// An empty `core.askPass` ends Git's askpass lookup where Windows drops the empty `GIT_ASKPASS`, so no dialog opens.
|
||||
'core.askPass=', 'core.hooksPath=/dev/null', 'core.fsmonitor=false', 'submodule.recurse=false', 'gc.auto=0', 'maintenance.auto=false',
|
||||
'protocol.allow=never', ...this.options.transports.map(transport => `protocol.${transport}.allow=always`),
|
||||
...policy === 'index' ? ['http.followRedirects=false'] : [],
|
||||
].flatMap(setting => ['-c', setting])
|
||||
const result = await execa('git', [...safety, ...args], {
|
||||
// A blob's last byte may be a newline, so the output is kept exactly as Git wrote it.
|
||||
cwd, env: gitEnv(), extendEnv: false, stdin: 'ignore', encoding: 'buffer', stripFinalNewline: false, reject: false,
|
||||
cwd: dir, env, extendEnv: false, stdin: 'ignore', encoding: 'buffer', stripFinalNewline: false, reject: false,
|
||||
maxBuffer: { stdout: maxBuffer, stderr: this.options.maxRepositoryBytes },
|
||||
timeout: this.options.timeoutMs, cancelSignal: AbortSignal.any([signal, this.options.lifetime, ...stop === undefined ? [] : [stop]]),
|
||||
killDescendants: true, killSignal: 'SIGKILL',
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { LocalizedText } from '@deepseek-ai/dsh-package-manifest'
|
||||
import { defineTool, ToolArgsError } from '@deepseek-ai/dsh-tools'
|
||||
import type { MarketListingVersion } from './index.ts'
|
||||
import { PluginMarketError, pluginMarketToolError } from './error.ts'
|
||||
import { normalizeIndexUrl } from './index-url.ts'
|
||||
|
||||
/** Required services for the listing tool; `pluginMarket` is awaited inside `apply`. */
|
||||
export const inject = ['tools']
|
||||
@@ -72,6 +73,17 @@ function paged<T>(items: readonly T[], page: Page): { readonly slice: T[]; reado
|
||||
return { slice, nextOffset: next < items.length ? next : null }
|
||||
}
|
||||
|
||||
/** An invalid Git address from a profile may contain credentials. Only Settings needs it for removal. */
|
||||
function canListIndex(url: string): boolean {
|
||||
if (!url.startsWith('git+')) return true
|
||||
try {
|
||||
normalizeIndexUrl(url)
|
||||
return true
|
||||
} catch (_invalidAddress) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the read-only `plugin_market` tool while the `pluginMarket` service is mounted. The service comes from the
|
||||
* optional custom plugin indexes bundle, so a preset can keep this row without the tool appearing or the row waiting.
|
||||
@@ -103,7 +115,7 @@ function registerTool(ctx: Context): void {
|
||||
switch (args.action) {
|
||||
case 'list_indexes':
|
||||
return JSON.stringify({
|
||||
indexes: market.listIndexes().map(({ url, title, error }) => ({
|
||||
indexes: market.listIndexes().filter(({ url }) => canListIndex(url)).map(({ url, title, error }) => ({
|
||||
url, title: english(title) ?? null, ...error === undefined ? {} : { error },
|
||||
})),
|
||||
})
|
||||
|
||||
@@ -7,11 +7,11 @@ import type { DetailFailureReason } from '@deepseek-ai/dsh-plugin-detail/types'
|
||||
|
||||
declare module '@deepseek-ai/dsh-typert-protocol' {
|
||||
interface RemoteErrorDetailsMap {
|
||||
/** An index URL is not http(s), or carries credentials or a fragment. */
|
||||
/** An index address is invalid for its HTTP(S) or Git source. */
|
||||
'plugin-market/invalid-index-url': { readonly url: string; readonly reason: string }
|
||||
/** The URL is not one of the configured index sources. */
|
||||
'plugin-market/unknown-index': { readonly url: string }
|
||||
/** The index could not be fetched: network failure, timeout, redirect, non-2xx status, or a body over the size limit. */
|
||||
/** The source did not supply the index, or the index exceeded its size limit. */
|
||||
'plugin-market/fetch-failed': { readonly url: string; readonly reason: string }
|
||||
/** The fetched document is not valid format-1 JSON; `path` names the offending JSON value. */
|
||||
'plugin-market/invalid-index': { readonly url: string; readonly path: string; readonly reason: string }
|
||||
|
||||
@@ -43,14 +43,15 @@ it('saves index sources without remounting, announces them, and restores them at
|
||||
const fiber = entry.fiber
|
||||
let changes = 0
|
||||
ctx.on('plugin-market/changed', () => { changes++ })
|
||||
await market.setIndexes(['https://second.example/index.json ', 'http://127.0.0.1:8080/index.json'])
|
||||
expect(market.listIndexes().map(index => index.url)).toEqual(['https://second.example/index.json', 'http://127.0.0.1:8080/index.json'])
|
||||
const sources = ['https://second.example/index.json', 'http://127.0.0.1:8080/index.json', 'git+ssh://[email protected]/plugins/market.git']
|
||||
await market.setIndexes(['https://second.example/index.json ', ...sources.slice(1)])
|
||||
expect(market.listIndexes().map(index => index.url)).toEqual(sources)
|
||||
expect(entry.fiber === fiber).toBe(true)
|
||||
expect(changes).toBe(1)
|
||||
expect(readFileSync(profile.patchPath, 'utf8')).toContain('https://second.example/index.json')
|
||||
await ctx.fiber.dispose()
|
||||
ctx = await start()
|
||||
expect(ctx.get('pluginMarket')!.listIndexes().map(index => index.url)).toEqual(['https://second.example/index.json', 'http://127.0.0.1:8080/index.json'])
|
||||
expect(ctx.get('pluginMarket')!.listIndexes().map(index => index.url)).toEqual(sources)
|
||||
} finally {
|
||||
try { await ctx?.fiber.dispose() } finally { rmSync(home, { recursive: true, force: true }) }
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { Context, Service } from '@deepseek-ai/cordis'
|
||||
import { updateVolatile } from '@deepseek-ai/cosmokit'
|
||||
import { getDshRuntimeVersion } from '@deepseek-ai/dsh-app-boot'
|
||||
import { DetailFailure } from '@deepseek-ai/dsh-plugin-detail'
|
||||
import type { BundleInfo } from '@deepseek-ai/dsh-plugin-manager/types'
|
||||
import { remoteErrorOf } from '@deepseek-ai/dsh-typert-protocol'
|
||||
import { afterEach, expect, it, onTestFinished, vi } from 'vitest'
|
||||
import PluginMarket, { type Config, type MarketQuery } from '../src/index.ts'
|
||||
import { parseIndexBody } from '../src/parse.ts'
|
||||
import { RepositoryCache } from '../src/repository-cache.ts'
|
||||
|
||||
/** Clone cache directory of services whose tests read no repository; nothing creates it. */
|
||||
const UNUSED_CACHE = '/nonexistent/plugin-market-detail-cache'
|
||||
@@ -39,7 +41,13 @@ function entry(name: string, fields: Record<string, unknown> = {}, versions: Rec
|
||||
return { name, versions, ...fields }
|
||||
}
|
||||
|
||||
async function mount(config: Partial<{ indexes: string[]; fetchTimeoutMs: number; maxBytes: number; cacheTtlMs: number }> = {}, options: {
|
||||
async function mount(config: Partial<{
|
||||
indexes: string[]
|
||||
fetchTimeoutMs: number
|
||||
detailGitTimeoutMs: number
|
||||
maxBytes: number
|
||||
cacheTtlMs: number
|
||||
}> = {}, options: {
|
||||
bundles?: BundleInfo[]
|
||||
exemptions?: Record<string, string[]>
|
||||
settings?: (ns: string, patch: object) => Promise<void>
|
||||
@@ -99,6 +107,101 @@ async function failure(promise: Promise<unknown>) {
|
||||
return remoteErrorOf(await promise.then(() => { throw new Error('resolved') }, (error: unknown) => error))
|
||||
}
|
||||
|
||||
/** Simulate an index transport that settles only when its request is aborted. */
|
||||
function waitForAbort<T>(signal: AbortSignal): Promise<T> {
|
||||
return new Promise((_resolve, reject) => {
|
||||
signal.addEventListener('abort', () => {
|
||||
const reason: unknown = signal.reason
|
||||
reject(reason instanceof Error ? reason : new Error('Index read aborted'))
|
||||
}, { once: true })
|
||||
})
|
||||
}
|
||||
|
||||
it('uses Git to read a configured index and refreshes it through the same repository address', async () => {
|
||||
const url = 'git+ssh://[email protected]/team/plugins.git?path=market%2Findex.json&ref=release%2Fstable'
|
||||
const git = vi.spyOn(RepositoryCache.prototype, 'readIndex')
|
||||
.mockResolvedValueOnce(new TextEncoder().encode(JSON.stringify(index([entry('first')]))))
|
||||
.mockResolvedValueOnce(new TextEncoder().encode(JSON.stringify(index([entry('second')]))))
|
||||
onTestFinished(() => { git.mockRestore() })
|
||||
const fetch = serve()
|
||||
const { market } = await mount({ indexes: [url], maxBytes: 4096 })
|
||||
expect((await read(market, url)).entries.map(plugin => plugin.name)).toEqual(['first'])
|
||||
expect((await read(market, url)).entries.map(plugin => plugin.name)).toEqual(['first'])
|
||||
expect(git).toHaveBeenCalledTimes(1)
|
||||
expect((await read(market, url, true)).entries.map(plugin => plugin.name)).toEqual(['second'])
|
||||
expect(git).toHaveBeenCalledTimes(2)
|
||||
expect(git).toHaveBeenLastCalledWith('ssh://[email protected]/team/plugins.git', 'release/stable', 'market/index.json', 4096, expect.any(AbortSignal))
|
||||
expect(fetch).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('lets a Git index read outlive the HTTP deadline and aborts it at the Git deadline', async () => {
|
||||
const url = 'git+ssh://[email protected]/team/plugins.git'
|
||||
const fetchTimeoutMs = 15_000
|
||||
const detailGitTimeoutMs = 60_000
|
||||
const httpDeadline = new AbortController()
|
||||
const gitDeadline = new AbortController()
|
||||
const deadline = vi.spyOn(AbortSignal, 'timeout').mockImplementation(ms =>
|
||||
ms === fetchTimeoutMs ? httpDeadline.signal : gitDeadline.signal)
|
||||
onTestFinished(() => { deadline.mockRestore() })
|
||||
serve((init) => {
|
||||
if (init.signal == null) throw new Error('HTTP index read has no abort signal')
|
||||
return waitForAbort(init.signal)
|
||||
})
|
||||
const gitRead = vi.spyOn(RepositoryCache.prototype, 'readIndex').mockImplementationOnce((_repository, _ref, _path, _limit, signal) =>
|
||||
waitForAbort(signal))
|
||||
onTestFinished(() => { gitRead.mockRestore() })
|
||||
const { market } = await mount({ indexes: [URL_A, url], fetchTimeoutMs, detailGitTimeoutMs })
|
||||
const http = failure(read(market, URL_A))
|
||||
const git = failure(read(market, url))
|
||||
|
||||
httpDeadline.abort(new Error('HTTP deadline'))
|
||||
expect(await http).toMatchObject({ code: 'plugin-market/fetch-failed', details: { reason: 'HTTP deadline' } })
|
||||
expect(gitRead.mock.calls[0]?.[4].aborted).toBe(false)
|
||||
expect(deadline.mock.calls).toEqual([[fetchTimeoutMs], [detailGitTimeoutMs]])
|
||||
|
||||
gitDeadline.abort(new Error('Git deadline'))
|
||||
expect(await git).toMatchObject({ code: 'plugin-market/fetch-failed', details: { reason: 'Git deadline' } })
|
||||
})
|
||||
|
||||
it.each([
|
||||
[new DetailFailure('denied', 'raw Git diagnostics'), 'Check Host Git authentication'],
|
||||
[new DetailFailure('git-unavailable', 'raw Git diagnostics'), 'Git is unavailable on the Host'],
|
||||
[new DetailFailure('network', 'raw Git diagnostics'), 'Git could not connect'],
|
||||
[new DetailFailure('too-large', 'raw Git diagnostics'), 'exceeds its size limit'],
|
||||
[new DetailFailure('invalid', 'raw Git diagnostics'), 'Git could not read the index file'],
|
||||
[new Error('raw Git diagnostics'), 'Git could not read the index file'],
|
||||
[undefined, 'No regular index file at index.json'],
|
||||
])('reports a Git read failure without forwarding subprocess diagnostics: %s', async (error, message) => {
|
||||
const url = 'git+https://github.com/team/plugins.git'
|
||||
const git = vi.spyOn(RepositoryCache.prototype, 'readIndex')
|
||||
onTestFinished(() => { git.mockRestore() })
|
||||
if (error === undefined) git.mockResolvedValueOnce(undefined)
|
||||
else git.mockRejectedValueOnce(error)
|
||||
const { market } = await mount({ indexes: [url] })
|
||||
const result = await failure(read(market, url))
|
||||
expect(result?.code).toBe('plugin-market/fetch-failed')
|
||||
expect(result?.message).toContain(message)
|
||||
expect(market.listIndexes()[0]?.error).not.toContain('raw Git diagnostics')
|
||||
})
|
||||
|
||||
it('cancels the Git index read when the market is disposed', async () => {
|
||||
const url = 'git+ssh://[email protected]/team/plugins.git'
|
||||
const git = vi.spyOn(RepositoryCache.prototype, 'readIndex').mockImplementationOnce((_repository, _ref, _path, _limit, signal) =>
|
||||
waitForAbort(signal))
|
||||
onTestFinished(() => { git.mockRestore() })
|
||||
const { market, ctx } = await mount({ indexes: [url] })
|
||||
const pending = failure(read(market, url))
|
||||
await ctx.fiber.dispose()
|
||||
expect(await pending).toMatchObject({ code: 'plugin-market/fetch-failed', details: { reason: 'Plugin market disposed' } })
|
||||
})
|
||||
|
||||
it('refuses a malformed Git URL without including the raw address in the error', async () => {
|
||||
const { market } = await mount({}, { settings: () => Promise.resolve() })
|
||||
expect(await failure(market.setIndexes(['git+ssh://[']))).toMatchObject({
|
||||
code: 'plugin-market/invalid-index-url', message: 'Use a valid Git repository address', details: { url: '', reason: 'git-source' },
|
||||
})
|
||||
})
|
||||
|
||||
it('reads an index with installation status, compatibility, and install arguments', async () => {
|
||||
const runtime = getDshRuntimeVersion()
|
||||
const fetch = serve(json(index([
|
||||
|
||||
@@ -6,6 +6,7 @@ import { tmpdir } from 'node:os'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
|
||||
import * as atomicWrite from '@deepseek-ai/dsh-atomic-write'
|
||||
import { DetailFailure } from '@deepseek-ai/dsh-plugin-detail'
|
||||
import { RepositoryCache, type RepositoryCacheOptions } from '../src/repository-cache.ts'
|
||||
|
||||
@@ -107,6 +108,55 @@ it('reads files at a pinned commit and the default branch, fetching contents onl
|
||||
await repositories.settled()
|
||||
})
|
||||
|
||||
it('refreshes movable Git index refs and preserves pinned commits', async () => {
|
||||
const source = repository('index', { 'index.json': 'first' })
|
||||
git(source.dir, 'branch', 'release/market')
|
||||
const ssh = join(root, 'index-ssh.cjs')
|
||||
// Git negotiates with a real upload-pack process without a listening SSH server.
|
||||
writeFileSync(ssh, `
|
||||
const { spawnSync } = require('node:child_process')
|
||||
if (process.argv[2] === '-G') process.exit(0)
|
||||
const result = spawnSync('git', ['upload-pack', process.env.PLUGIN_MARKET_TEST_REPOSITORY], { stdio: 'inherit' })
|
||||
process.exit(result.status ?? 1)
|
||||
`)
|
||||
vi.stubEnv('PLUGIN_MARKET_TEST_NODE', process.execPath)
|
||||
vi.stubEnv('PLUGIN_MARKET_TEST_SSH', ssh)
|
||||
vi.stubEnv('PLUGIN_MARKET_TEST_REPOSITORY', source.dir)
|
||||
vi.stubEnv('GIT_SSH_COMMAND', '"$PLUGIN_MARKET_TEST_NODE" "$PLUGIN_MARKET_TEST_SSH"')
|
||||
const url = 'https://git.example/team/index.git'
|
||||
writeFileSync(join(root, 'home', '.gitconfig'), `[url "ssh://[email protected]/team/index.git"]\n insteadOf = ${url}\n`)
|
||||
const repositories = cache()
|
||||
const read = async (ref?: string) => text(await repositories.readIndex(url, ref, 'index.json', 100, signal))
|
||||
expect(await read()).toBe('first')
|
||||
expect(await read('release/market')).toBe('first')
|
||||
writeFileSync(join(source.dir, 'index.json'), 'second')
|
||||
git(source.dir, 'commit', '--quiet', '-am', 'second')
|
||||
expect(await read()).toBe('second')
|
||||
expect(await read('release/market')).toBe('first')
|
||||
git(source.dir, 'branch', '--force', 'release/market', 'HEAD')
|
||||
expect(await read('release/market')).toBe('second')
|
||||
expect(await read(source.commit)).toBe('first')
|
||||
})
|
||||
|
||||
it('keeps an index on its configured remote when a detail clone switched to SSH', async () => {
|
||||
const source = repository('fallback', { 'index.json': '{}' })
|
||||
const url = 'https://git.example/team/plugin.git'
|
||||
const ssh = 'ssh://[email protected]/team/plugin.git'
|
||||
const config = join(root, 'home', '.gitconfig')
|
||||
const rewrites = [
|
||||
'[url "http://127.0.0.1:1/plugin.git"]', ` insteadOf = ${url}`,
|
||||
`[url "${source.url}"]`, ` insteadOf = ${ssh}`, '',
|
||||
].join('\n')
|
||||
writeFileSync(config, `${rewrites}[protocol "http"]\n allow = never\n`)
|
||||
const repositories = cache()
|
||||
expect(text(await repositories.read(url, undefined, 'index.json', 100, signal))).toBe('{}')
|
||||
writeFileSync(config, `${rewrites}[protocol "http"]\n allow = always\n`)
|
||||
const index = repositories.readIndex(url, undefined, 'index.json', 100, signal)
|
||||
await expectRejection(index, { reason: 'denied' }, `${url}: git fetch`)
|
||||
await expect(index).rejects.toThrow("transport 'http' not allowed")
|
||||
expect(readdirSync(join(root, 'cache'))).toEqual([cloneName(url)])
|
||||
})
|
||||
|
||||
it('picks the README of a root directory by name order, in any letter case', async () => {
|
||||
const source = repository('b', { 'readme.markdown': 'second', 'Readme.md': 'first', 'docs/readme': 'plain' })
|
||||
const repositories = cache()
|
||||
@@ -328,6 +378,81 @@ it('serializes one repository across caches that share the directory, as two pro
|
||||
expect(readdirSync(join(root, 'cache')).filter(name => !name.endsWith('.lock'))).toHaveLength(1)
|
||||
})
|
||||
|
||||
it.each(['in-process queue', 'shared file lock'] as const)('cancels a Git index read waiting in the %s', async (waiting) => {
|
||||
const source = repository('cancel-index', { 'index.json': 'cached index' })
|
||||
const url = 'ssh://[email protected]/team/index.git'
|
||||
const dir = join(root, 'cache', cloneName(`index\0${url}`))
|
||||
mkdirSync(dirname(dir), { recursive: true })
|
||||
git(root, 'clone', '--bare', '--quiet', source.url, dir)
|
||||
git(dir, 'update-ref', `refs/dsh/${source.commit}`, source.commit)
|
||||
// A rebuilt cache must fail locally instead of trying to connect to the example remote.
|
||||
writeFileSync(join(root, 'home', '.gitconfig'), `[url "${source.url}"]\n insteadOf = ${url}\n`)
|
||||
const marker = join(dir, 'holder-marker')
|
||||
writeFileSync(marker, 'held')
|
||||
|
||||
const first = cache()
|
||||
const second = waiting === 'in-process queue' ? first : cache()
|
||||
const withFileLock = atomicWrite.withFileLock
|
||||
const release = Promise.withResolvers<undefined>()
|
||||
const entered = vi.fn()
|
||||
const order: string[] = []
|
||||
const lock = vi.spyOn(atomicWrite, 'withFileLock').mockImplementationOnce((path, operation, options) =>
|
||||
withFileLock(path, async () => {
|
||||
entered()
|
||||
await release.promise
|
||||
const result = await operation()
|
||||
order.push('holder')
|
||||
return result
|
||||
}, options))
|
||||
const reads: Promise<unknown>[] = []
|
||||
const read = (repositories: RepositoryCache, cancellation: AbortSignal) => {
|
||||
const pending = repositories.readIndex(url, source.commit, 'index.json', 100, cancellation)
|
||||
reads.push(Promise.allSettled([pending]))
|
||||
return pending
|
||||
}
|
||||
|
||||
try {
|
||||
const holder = read(first, signal)
|
||||
await vi.waitFor(() => { expect(entered).toHaveBeenCalledOnce() }, { timeout: 2000 })
|
||||
const attempted = vi.fn()
|
||||
let acquisitionSignal: AbortSignal | undefined
|
||||
if (waiting === 'shared file lock') {
|
||||
lock.mockImplementationOnce((path, operation, options) => {
|
||||
const acquiring = withFileLock(path, operation, options)
|
||||
acquisitionSignal = options?.signal
|
||||
attempted()
|
||||
return acquiring
|
||||
})
|
||||
}
|
||||
const cancellation = new AbortController()
|
||||
const rejected = vi.fn<(error: unknown) => void>()
|
||||
void read(second, cancellation.signal).catch(rejected)
|
||||
if (waiting === 'shared file lock') {
|
||||
await vi.waitFor(() => { expect(attempted).toHaveBeenCalledOnce() }, { timeout: 2000 })
|
||||
}
|
||||
const reason = new Error('index read cancelled')
|
||||
cancellation.abort(reason)
|
||||
await vi.waitFor(() => { expect(rejected).toHaveBeenCalledOnce() }, { timeout: 2000 })
|
||||
expect(lock).toHaveBeenCalledTimes(waiting === 'in-process queue' ? 1 : 2)
|
||||
if (waiting === 'shared file lock') expect(acquisitionSignal?.aborted).toBe(true)
|
||||
const failure = rejected.mock.calls[0]?.[0]
|
||||
expect(failure === reason || (failure instanceof Error && failure.cause === reason)).toBe(true)
|
||||
expect(existsSync(`${dir}.lock`)).toBe(true)
|
||||
expect(existsSync(marker)).toBe(true)
|
||||
|
||||
const live = read(second, signal).then((bytes) => { order.push('live'); return bytes })
|
||||
release.resolve(undefined)
|
||||
expect((await Promise.all([holder, live])).map(text)).toEqual(['cached index', 'cached index'])
|
||||
expect(order).toEqual(['holder', 'live'])
|
||||
expect(existsSync(marker)).toBe(true)
|
||||
} finally {
|
||||
release.resolve(undefined)
|
||||
await Promise.all(reads)
|
||||
await Promise.all([first.settled(), second.settled()])
|
||||
lock.mockRestore()
|
||||
}
|
||||
})
|
||||
|
||||
it('stops Git when the caller cancels or the service is disposed', async () => {
|
||||
const source = repository('i', { 'README.md': 'x' })
|
||||
const cancelled = new AbortController()
|
||||
@@ -336,8 +461,7 @@ it('stops Git when the caller cancels or the service is disposed', async () => {
|
||||
const disposed = new AbortController()
|
||||
disposed.abort(new Error('disposed'))
|
||||
await expect(cache({ lifetime: disposed.signal }).read(source.url, source.commit, 'README.md', 100, signal)).rejects.toThrow('disposed')
|
||||
// Neither a repository nor its staging directory remains.
|
||||
expect(readdirSync(join(root, 'cache'))).toEqual([])
|
||||
expect(existsSync(join(root, 'cache'))).toBe(false)
|
||||
})
|
||||
|
||||
it('reports file contents Git can no longer fetch and deletes the clone, ignoring an inherited GIT_DIR', async () => {
|
||||
|
||||
@@ -77,6 +77,14 @@ it('lists configured indexes with English titles', async () => {
|
||||
expect((await call({ action: 'list_indexes' })).json).toEqual({ indexes: [{ url: URL_A, title: 'Localized', error: `Could not fetch ${URL_A}: offline` }] })
|
||||
})
|
||||
|
||||
it('lists usable Git addresses without exposing invalid Git addresses from the profile', async () => {
|
||||
const git = 'git+ssh://[email protected]/team/plugins.git'
|
||||
const invalid = 'git+https://user:[email protected]/team/plugins.git'
|
||||
const { call, ctx } = await fixture([git, invalid])
|
||||
expect(ctx.pluginMarket.listIndexes().find(source => source.url === invalid)?.error).toBeDefined()
|
||||
expect((await call({ action: 'list_indexes' })).json).toEqual({ indexes: [{ url: git, title: null }] })
|
||||
})
|
||||
|
||||
it('pages plugins with the default version\'s install target and registry plugin_manager accepts', async () => {
|
||||
serve(document)
|
||||
const { call } = await fixture()
|
||||
|
||||
@@ -348,11 +348,6 @@
|
||||
- id: ui-plugin-manager
|
||||
name: '@deepseek-ai/dsh-client-ui-plugin-manager'
|
||||
|
||||
# Read-only Plugin list tab in the Settings Plugins section; the built-in
|
||||
# bundles the sidebar page leaves out are inspected here.
|
||||
- id: ui-settings-plugin-inventory
|
||||
name: '@deepseek-ai/dsh-client-ui-settings-plugin-inventory'
|
||||
|
||||
- id: ui-conversation
|
||||
name: '@deepseek-ai/dsh-client-ui-conversation'
|
||||
|
||||
@@ -470,12 +465,6 @@
|
||||
- id: ui-settings-session-log
|
||||
name: '@deepseek-ai/dsh-client-ui-settings-session-log'
|
||||
|
||||
# The Built-in plugins settings section: the navigation entry and the tab
|
||||
# row the inventory tab registers into. The official configuration pages
|
||||
# are the companion rows below.
|
||||
- id: ui-settings-plugins
|
||||
name: '@deepseek-ai/dsh-client-ui-settings-plugins'
|
||||
|
||||
# The official settings pages: one companion package per host-plane
|
||||
# namespace, each registering its page into the Plugins page while the
|
||||
# Host serves the namespace.
|
||||
|
||||
@@ -117,8 +117,6 @@
|
||||
"@deepseek-ai/dsh-client-ui-settings-agent-loop": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-settings-general": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-settings-models": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-settings-plugin-inventory": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-settings-plugins": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-settings-session-log": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-settings-shell": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-settings-subagent": "workspace:*",
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
en: 1eb35b015a6c423f
|
||||
zh: a8a3dceee2c9e943
|
||||
/client-web-gui-browser-half/packages:
|
||||
en: 45c1d8a1e1f44425
|
||||
zh: 47a5199bca1e7836
|
||||
en: e6b93119ee411a50
|
||||
zh: a9ed12dd8cc8864a
|
||||
/client-web-gui-browser-half/related-documentation:
|
||||
en: d1d506e68fab7333
|
||||
zh: 1a90fe6f3f8f24a9
|
||||
|
||||
@@ -72,7 +72,6 @@ The kernel packages boot and serve the page; the UI feature packages present it.
|
||||
| [`ui-model-selection/`](ui-model-selection/README.md) | Provides model selection in conversation surfaces | — |
|
||||
| [`ui-permission-presets/`](ui-permission-presets/README.md) | Configures default permissions and switches the current session's access | — |
|
||||
| [`ui-plan/`](ui-plan/README.md) | Presents active plan-mode status and its exit control | — |
|
||||
| [`ui-settings-plugins/`](ui-settings-plugins/README.md) | Owns the Built-in plugins settings section shell and its tab extension point | — |
|
||||
| [`ui-user-questions/`](ui-user-questions/README.md) | Presents interactive questions requested by the agent | — |
|
||||
| [`ui-agent-preset/`](ui-agent-preset/README.md) | Selects a session's agent preset and authors preset compositions | — |
|
||||
| [`ui-settings/`](ui-settings/README.md) | Hosts the settings interface and its extension areas | — |
|
||||
@@ -86,7 +85,6 @@ The kernel packages boot and serve the page; the UI feature packages present it.
|
||||
| [`ui-plugin-manager/`](ui-plugin-manager/README.md) | Contributes the sidebar Plugins panel: install, enable, disable, retry, and compose installed packages | — |
|
||||
| [`ui-entry-customization/`](ui-entry-customization/README.md) | Adds region-local More menus that pin or unpin plugin launchers and start a plugin draft | — |
|
||||
| [`ui-plugin-market/`](ui-plugin-market/README.md) | Contributes the Discover tab to the Plugins page: browse market indexes and install their bundles | — |
|
||||
| [`ui-settings-plugin-inventory/`](ui-settings-plugin-inventory/README.md) | Contributes the read-only Host Loader inventory tab to Plugins settings | — |
|
||||
| [`ui-deliverables/`](ui-deliverables/README.md) | Produces the changed-files card with its comparison tabs, delivery cards, and clickable final-response file references | — |
|
||||
| [`ui-message-feedback/`](ui-message-feedback/README.md) | Provides message ratings and feedback dialogs opened from ratings, `/feedback`, or the Session Header menu | `ctx.feedbackUi` |
|
||||
| [`ui-directory-picker-browse/`](ui-directory-picker-browse/README.md) | In-app directory browsing surface for the workspace directory flow | — |
|
||||
|
||||
@@ -72,7 +72,6 @@ kind: "package-group"
|
||||
| [`ui-model-selection/`](ui-model-selection/README.zh.md) | 在对话界面中提供模型选择 | — |
|
||||
| [`ui-permission-presets/`](ui-permission-presets/README.zh.md) | 配置默认权限并切换当前会话的访问模式 | — |
|
||||
| [`ui-plan/`](ui-plan/README.zh.md) | 展示生效中的 plan mode 状态及其退出控件 | — |
|
||||
| [`ui-settings-plugins/`](ui-settings-plugins/README.zh.md) | 负责「内置插件」设置分区壳及其标签页扩展点 | — |
|
||||
| [`ui-user-questions/`](ui-user-questions/README.zh.md) | 展示 agent 请求的交互式问题 | — |
|
||||
| [`ui-agent-preset/`](ui-agent-preset/README.zh.md) | 选择会话的 agent 预设并编写预设组合 | — |
|
||||
| [`ui-settings/`](ui-settings/README.zh.md) | 承载设置界面及其扩展区域 | — |
|
||||
@@ -86,7 +85,6 @@ kind: "package-group"
|
||||
| [`ui-plugin-manager/`](ui-plugin-manager/README.zh.md) | 贡献侧栏的“插件”面板:安装、启用、停用、重试与组合已安装的包 | — |
|
||||
| [`ui-entry-customization/`](ui-entry-customization/README.zh.md) | 添加分区域的“更多”菜单,固定或收起插件入口,并开始创建插件的草稿 | — |
|
||||
| [`ui-plugin-market/`](ui-plugin-market/README.zh.md) | 为“插件”页面贡献“发现”标签页:浏览市场索引并安装其中的组合包 | — |
|
||||
| [`ui-settings-plugin-inventory/`](ui-settings-plugin-inventory/README.zh.md) | 向「插件」设置贡献只读的 Host Loader 清单标签页 | — |
|
||||
| [`ui-deliverables/`](ui-deliverables/README.zh.md) | 生成改动文件卡片及其对比 tab、交付文件卡片与可点击的最终响应文件引用 | — |
|
||||
| [`ui-message-feedback/`](ui-message-feedback/README.zh.md) | 提供消息赞踩,以及从赞踩、`/feedback` 或会话标题栏菜单打开的反馈弹窗 | `ctx.feedbackUi` |
|
||||
| [`ui-directory-picker-browse/`](ui-directory-picker-browse/README.zh.md) | 面向工作区目录流程的应用内目录浏览界面 | — |
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
en: e1c5d886bc7da5bc
|
||||
zh: da8f0c309e178b74
|
||||
/deepseek-ai-dsh-client-hmr/use-this-package/what-a-reload-does:
|
||||
en: d3ac81d404b2d6c6
|
||||
zh: a9f9ad9dfa685ac7
|
||||
en: 4c72f150b89c2bb7
|
||||
zh: a6773cfd92c72f61
|
||||
/deepseek-ai-dsh-client-hmr/use-this-package/configuration:
|
||||
en: 8b4b8f929cf0ba25
|
||||
zh: 626779afc1132e4f
|
||||
@@ -42,8 +42,8 @@
|
||||
en: 191b6aa1dfd7de08
|
||||
zh: f7a4e65bea2e2bd8
|
||||
/deepseek-ai-dsh-client-hmr/understand-the-implementation/failure-policy:
|
||||
en: 5c9939cd350c136d
|
||||
zh: 020159ec196f378f
|
||||
en: cc2114489f83dc70
|
||||
zh: 6268962333946c82
|
||||
/deepseek-ai-dsh-client-hmr/understand-the-implementation/source-map:
|
||||
en: 67728b630b30b9aa
|
||||
zh: 55861de2169ecafe
|
||||
|
||||
@@ -33,7 +33,7 @@ Run `pnpm run dev:web`, which starts the host and the rebuild watchers together
|
||||
|
||||
### What a reload does
|
||||
|
||||
Each successful reload re-executes the plugin bundle and remounts the plugin with fresh state. Plugins that depend on the reloaded one reload with it automatically. Failures appear in the plugin list, where they can be retried without waiting for another rebuild.
|
||||
Each successful reload re-executes the plugin bundle and remounts the plugin with fresh state. Plugins that depend on the reloaded one reload with it automatically. Failures appear in the Plugins page's synchronization notice, where they can be retried without waiting for another rebuild.
|
||||
|
||||
### Configuration
|
||||
|
||||
@@ -71,7 +71,7 @@ A fiber's activation epoch strings its service providers' uids, so replacing a p
|
||||
|
||||
### Failure policy
|
||||
|
||||
Download failures leave the running plugin active. After the old fiber is torn down, import or activation failure does not restore the previous bundle. Failures appear as page-local synchronization errors. Settings → Plugins → Plugin list retries the latest graph, even when its revision is unchanged; a later rebuild also retries the affected plugin. Successful unrelated plugins remain active.
|
||||
Download failures leave the running plugin active. After the old fiber is torn down, import or activation failure does not restore the previous bundle. Failures appear as page-local synchronization errors. **Retry this page** on the Plugins page retries the latest graph, even when its revision is unchanged; a later rebuild also retries the affected plugin. Successful unrelated plugins remain active.
|
||||
|
||||
### Source map
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ kind: "package-reference"
|
||||
|
||||
### 一次重载做什么
|
||||
|
||||
每次成功的重载都会重新执行插件 bundle,并用全新状态重新挂载插件。依赖被重载插件的插件会随之自动重载。失败会显示在插件列表中,可直接重试,无需等待下一次重建。
|
||||
每次成功的重载都会重新执行插件 bundle,并用全新状态重新挂载插件。依赖被重载插件的插件会随之自动重载。失败会显示在插件页面的同步提示中,可直接重试,无需等待下一次重建。
|
||||
|
||||
### 配置
|
||||
|
||||
@@ -71,7 +71,7 @@ fiber 的激活 epoch 会串联其服务提供方的 uid,因此替换提供方
|
||||
|
||||
### 失败策略
|
||||
|
||||
下载失败时,正在运行的插件保持活动。旧 fiber 被卸载后,导入或激活失败不会恢复先前的 bundle。失败会显示为当前页面的同步错误。「设置 → 插件 → 插件列表」会针对最新图重试,即使其 revision 未变化;后续重建也会重试受影响的插件。无关且已成功运行的插件保持活动。
|
||||
下载失败时,正在运行的插件保持活动。旧 fiber 被卸载后,导入或激活失败不会恢复先前的 bundle。失败会显示为当前页面的同步错误。插件页面的「重试本页面同步」会针对最新图重试,即使其 revision 未变化;后续重建也会重试受影响的插件。无关且已成功运行的插件保持活动。
|
||||
|
||||
### 源码地图
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
en: 1383d68472b3c057
|
||||
zh: 94dd7d9abbdbccf3
|
||||
/deepseek-ai-dsh-client-modules/use-this-package/live-plugin-composition:
|
||||
en: 252613c45e5e46f5
|
||||
zh: fa44cf77c86019af
|
||||
en: 4487b06ddced3b71
|
||||
zh: 26d0181fcf0229ca
|
||||
/deepseek-ai-dsh-client-modules/use-this-package/host-release-changes:
|
||||
en: 5c0aa6f1d8df8e1c
|
||||
zh: 34005131c9bdce3b
|
||||
|
||||
@@ -44,7 +44,7 @@ The application combo scripts carry only each plugin's `client.js` entry and reg
|
||||
|
||||
### Live plugin composition
|
||||
|
||||
An open Web page follows the Host's complete module graph through the HMR transport. Enabling an ordinary plugin adds its Loader entry; disabling it removes the entry and waits for its asynchronous effects before evicting unused modules and styles. Re-enabling loads one instance with its styles. Other Loader contributors and shared modules still needed by active entries remain loaded. Settings → Plugins → Plugin list shows page-local synchronization failures and offers retry without changing Host enablement.
|
||||
An open Web page follows the Host's complete module graph through the HMR transport. Enabling an ordinary plugin adds its Loader entry; disabling it removes the entry and waits for its asynchronous effects before evicting unused modules and styles. Re-enabling loads one instance with its styles. Other Loader contributors and shared modules still needed by active entries remain loaded. The Plugins page shows page-local synchronization failures and offers retry without changing Host enablement.
|
||||
|
||||
<a id="host-release-changes"></a>
|
||||
### Host release changes
|
||||
|
||||
@@ -44,7 +44,7 @@ application combo 脚本只携带每个插件的 `client.js` 入口,并在启
|
||||
|
||||
### 插件动态组合
|
||||
|
||||
已打开的 Web 页面通过 HMR 传输跟随 Host 的完整模块图。启用普通插件会添加其 Loader 条目;停用会移除条目,并在其异步 effect 完成清理后回收未使用的模块与样式。再次启用会加载一个带样式的实例。其他 Loader 贡献方的条目及活动条目仍需使用的共享模块会保留。「设置 → 插件 → 插件列表」显示当前页面的同步失败,并提供不改变 Host 启用状态的重试。
|
||||
已打开的 Web 页面通过 HMR 传输跟随 Host 的完整模块图。启用普通插件会添加其 Loader 条目;停用会移除条目,并在其异步 effect 完成清理后回收未使用的模块与样式。再次启用会加载一个带样式的实例。其他 Loader 贡献方的条目及活动条目仍需使用的共享模块会保留。插件页面显示当前页面的同步失败,并提供不改变 Host 启用状态的重试。
|
||||
|
||||
<a id="host-release-changes"></a>
|
||||
### Host release 变化
|
||||
|
||||
@@ -97,7 +97,7 @@ function compiledClientStyle(
|
||||
* Everything else under @deepseek-ai/* is either a module-table entry
|
||||
* (external) or a leak the purity gate rejects.
|
||||
*/
|
||||
export const INLINE_SAFE = /^(?:@deepseek-ai\/dsh-(?:file-reference|fs-patch|session|llm|tools|brand|error|official-bundles|deque|output-retention|typert-protocol|util-crypto|util-text-search|util-time|util-values|util-workspace-path)(?:\/|$)|@deepseek-ai\/dsh-util-file-drag$|@deepseek-ai\/dsh-token-meter\/client$|@deepseek-ai\/dsh-commands\/builtin$|@deepseek-ai\/dsh-native-command\/types$|@deepseek-ai\/dsh-host-open-in-app\/shared$|@deepseek-ai\/dsh-plugin-manager\/registry$|@deepseek-ai\/dsh-agent-preset-registry\/display$|@deepseek-ai\/dsh-api-workspace-controller\/default-workspace$|@deepseek-ai\/dsh-spill-policy\/notice$)/
|
||||
export const INLINE_SAFE = /^(?:@deepseek-ai\/dsh-(?:file-reference|fs-patch|session|llm|tools|brand|error|official-bundles|deque|output-retention|typert-protocol|util-crypto|util-text-search|util-time|util-values|util-workspace-path)(?:\/|$)|@deepseek-ai\/dsh-util-file-drag$|@deepseek-ai\/dsh-token-meter\/client$|@deepseek-ai\/dsh-commands\/builtin$|@deepseek-ai\/dsh-native-command\/types$|@deepseek-ai\/dsh-host-open-in-app\/shared$|@deepseek-ai\/dsh-plugin-manager\/registry$|@deepseek-ai\/dsh-plugin-market-index\/source$|@deepseek-ai\/dsh-agent-preset-registry\/display$|@deepseek-ai\/dsh-api-workspace-controller\/default-workspace$|@deepseek-ai\/dsh-spill-policy\/notice$)/
|
||||
|
||||
/**
|
||||
* Vendored framework libraries: rescoped into @deepseek-ai, so the gate below
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
en: 5ee429751fcbeb4f
|
||||
zh: 981a37018b6cae3a
|
||||
/deepseek-ai-dsh-client-ui-chat/reference-previews:
|
||||
en: 90e75f3a18a86854
|
||||
zh: bb7b0a10050de9aa
|
||||
en: c07a50787d77a7cd
|
||||
zh: 70ee4e32d664e88e
|
||||
/deepseek-ai-dsh-client-ui-chat/hidden-chat-rows:
|
||||
en: 8ca277dc7fed699f
|
||||
zh: 167478dba50f3904
|
||||
|
||||
@@ -38,7 +38,7 @@ Image drag actions arrive through the image entry’s inject face from [ui-file-
|
||||
|
||||
Sent generic-file attachments retain the draft's [file-card radius](../../../docs/ui-radius.md#radius-scale).
|
||||
|
||||
`ChatView` supplies file and HTTP(S) navigation through the existing `MarkdownDelegateProvider` around its node list, passing `requestOpenFile`, `openExternalLink`, and `fileImages` directly. Its file opener retains Chat's failure feedback and retry handling. Assistant Markdown file links open in the right Sidebar after the message settles, including references to unmodified files. Relative link and image paths in an Assistant message resolve from the directory that was current when the message was written, using the `workingDirectoryHistory` projection; without that history they resolve from the Session's current working directory, or its workspace root when none is recorded; absolute paths retain the same Session's filesystem access. [Supported Markdown line references](../ui-primitives/README.md#rendering-agent-output) navigate to the first specified line and reuse an existing file tab. Missing files show the preview's error state.
|
||||
`ChatView` supplies file and HTTP(S) navigation through the existing `MarkdownDelegateProvider` around its node list, passing `requestOpenFile`, `openExternalLink`, and `fileImages` directly. Its file opener retains Chat's failure feedback and retry handling. Assistant Markdown file links open in the right Sidebar after the message settles, including references to unmodified files. Relative paths resolve in the viewed Session's workspace; absolute paths retain the same Session's filesystem access. [Supported Markdown line references](../ui-primitives/README.md#rendering-agent-output) navigate to the first specified line and reuse an existing file tab. Missing files show the preview's error state.
|
||||
|
||||
`ChatView` also passes `renderCode`, so each Markdown fence in the Chat flow that has a language and content renders through the session-scoped `conversation.chat.markdown.fence` hoc slot. Its `entryKey` is the lowercased fence language, and its owner props carry that `lang`, the fence `code`, the `streaming` state, and `meta`, the rest of the info string when present. The slot content is a plain code block without unified-diff rows, so a language without a layer renders as code. Chat registers layers for `math`, which shows the source while the message streams and display TeX after it settles, and for `diff` and `patch`, which render unified-diff rows in place of the content. Other plugins add a language by registering a layer whose `key` is the lowercased language: a layer that omits `children` replaces the code block, a layer that renders `children` decorates it, and either may parse its own parameters from `meta`.
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ kind: "package-reference"
|
||||
|
||||
已发送的普通文件附件保留草稿中的[文件卡片圆角](../../../docs/ui-radius.zh.md#radius-scale)。
|
||||
|
||||
`ChatView` 通过节点列表外围既有的 `MarkdownDelegateProvider` 提供文件及 HTTP(S) 导航,直接传入 `requestOpenFile`、`openExternalLink` 和 `fileImages`。文件打开动作保留 Chat 的失败反馈与重试处理。Assistant Markdown 文件链接在消息落定后可于右侧栏打开,包括未修改文件的引用。Assistant 消息中的相对链接与图片路径按该消息写下时的当前目录解析(取自 `workingDirectoryHistory` 投影);没有该历史时按 Session 的当前工作目录解析,未记录时回落到其工作区根目录;绝对路径仍使用同一 Session 的文件系统访问。[支持的 Markdown 行号引用](../ui-primitives/README.zh.md#rendering-agent-output)定位到指定起始行,并复用现有文件标签。文件缺失时显示预览错误状态。
|
||||
`ChatView` 通过节点列表外围既有的 `MarkdownDelegateProvider` 提供文件及 HTTP(S) 导航,直接传入 `requestOpenFile`、`openExternalLink` 和 `fileImages`。文件打开动作保留 Chat 的失败反馈与重试处理。Assistant Markdown 文件链接在消息落定后可于右侧栏打开,包括未修改文件的引用。相对路径基于当前查看的 Session 工作区解析;绝对路径仍使用同一 Session 的文件系统访问。[支持的 Markdown 行号引用](../ui-primitives/README.zh.md#rendering-agent-output)定位到指定起始行,并复用现有文件标签。文件缺失时显示预览错误状态。
|
||||
|
||||
`ChatView` 还传入 `renderCode`,因此 Chat 消息流中带语言且有内容的每个 Markdown 围栏都经由 session 作用域的 `conversation.chat.markdown.fence` hoc slot 渲染。其 `entryKey` 为小写的围栏语言,owner props 携带该 `lang`、围栏 `code`、`streaming` 状态,以及存在时为 info string 其余部分的 `meta`。slot 内容是不带统一 diff 行的普通代码块,因此没有对应层的语言按代码渲染。Chat 自带 `math` 层,消息流式输出时显示源码,落定后显示行间 TeX;还自带 `diff` 与 `patch` 层,以统一 diff 行代替内容渲染。其他插件注册 `key` 为小写语言的层即可接入该语言:不渲染 `children` 的层替换代码块,渲染 `children` 的层装饰代码块,两者都可以自行从 `meta` 解析参数。
|
||||
|
||||
|
||||
@@ -100,8 +100,7 @@
|
||||
"@deepseek-ai/dsh-settings": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-product-analytics": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-file-drag": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-context-menu": "workspace:*",
|
||||
"@deepseek-ai/dsh-working-directory": "workspace:*"
|
||||
"@deepseek-ai/dsh-client-ui-context-menu": "workspace:*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@deepseek-ai/schemastery": "workspace:~"
|
||||
|
||||
@@ -3,7 +3,7 @@ import { fileMediaUrl } from '@deepseek-ai/dsh-util-workspace-path'
|
||||
import type { PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots'
|
||||
import type { ReactNode } from 'react'
|
||||
import { JsonBlock, MarkdownText } from '@deepseek-ai/dsh-client-ui-primitives'
|
||||
import type { MarkdownFileMentions, MarkdownPathImages, MarkdownPathResolver } from '@deepseek-ai/dsh-client-ui-primitives'
|
||||
import type { MarkdownFileMentions, MarkdownPathImages } from '@deepseek-ai/dsh-client-ui-primitives'
|
||||
import type { ChatNodeOwnerProps, ChatViewSlotProps, UseDisclosure, UsePresentation, UseGroupAction } from '../contract/slots.ts'
|
||||
import type { AssistantBlock } from '../contract/snapshot.ts'
|
||||
import { markdownLabels } from '../markdown-labels.ts'
|
||||
@@ -50,8 +50,6 @@ export interface AssistantMarkdownProps extends
|
||||
revealProcess?: (() => void) | undefined
|
||||
/** Resolved prose file mentions for this Assistant's closing turn. */
|
||||
mentions?: MarkdownFileMentions | undefined
|
||||
/** Maps local link and image destinations of the response text; reasoning keeps the delegate's resolution. */
|
||||
resolvePath?: MarkdownPathResolver | undefined
|
||||
/** The owning view's locale seat, passed down as a plain prop. */
|
||||
t: ChatViewSlotProps['t']
|
||||
}
|
||||
@@ -59,7 +57,7 @@ export interface AssistantMarkdownProps extends
|
||||
/** Renders non-blank reasoning blocks as independent disclosures alongside the response. */
|
||||
export const AssistantMarkdown = memo(function AssistantMarkdown({
|
||||
blocks, streaming, textInteractionSource = false, interrupted, loadImage, groupPart, useDisclosure,
|
||||
reasoningHidden = false, usePresentation, revealProcess, mentions, resolvePath, renderSlot, useGroupAction, t,
|
||||
reasoningHidden = false, usePresentation, revealProcess, mentions, renderSlot, useGroupAction, t,
|
||||
}: AssistantMarkdownProps) {
|
||||
// Stable per locale revision (t identity changes on switch): a fresh object
|
||||
// per render would rebuild MarkdownText's component table every chunk.
|
||||
@@ -92,7 +90,6 @@ export const AssistantMarkdown = memo(function AssistantMarkdown({
|
||||
labels={labels}
|
||||
fileMentions={mentions}
|
||||
pathImages={pathImages}
|
||||
resolvePath={resolvePath}
|
||||
textInteractionSource={textInteractionSource}
|
||||
/>,
|
||||
)
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { memo, useCallback, useMemo } from 'react'
|
||||
import type { InjectFace, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots'
|
||||
import { resolveWorkspacePath } from '@deepseek-ai/dsh-util-workspace-path'
|
||||
import type {} from '@deepseek-ai/dsh-working-directory/client'
|
||||
import type { ChatFileMentions, ChatNodeViewProps, PresentationInjected, TurnTailOwnerProps } from '../contract/slots.ts'
|
||||
import { AssistantMarkdown } from './AssistantMarkdown.tsx'
|
||||
import { directoryAt } from './directory-at.ts'
|
||||
|
||||
/** Business readers owned by the assistant renderer's existing Slot registration. */
|
||||
export interface AssistantNodeInjected extends PresentationInjected {
|
||||
@@ -20,7 +17,7 @@ type AssistantNodeViewProps = ChatNodeViewProps<'assistant-step'> & InjectFace<A
|
||||
/** Streaming, settled, and interrupted Assistant states share one keyed renderer instance. */
|
||||
export const AssistantNodeView = memo(function AssistantNodeView({
|
||||
node, groupPart, useDisclosure, useGroupAction, useTurnData, turnProcess, openFile, loadImage, fileMentions,
|
||||
usePresentation, renderSlot, t, sessionId, useContextMenu, resolveFilePath, useProjection,
|
||||
usePresentation, renderSlot, t, sessionId, useContextMenu, resolveFilePath,
|
||||
}: AssistantNodeViewProps) {
|
||||
const { getTriggerProps } = useContextMenu()
|
||||
const getFileTriggerProps = useCallback((path: string) => getTriggerProps(() => ({
|
||||
@@ -49,12 +46,6 @@ export const AssistantNodeView = memo(function AssistantNodeView({
|
||||
: turnProcess.spec.answerStep === data.step && turnProcess.spec.inlineReasoning)
|
||||
&& !turnProcess.open
|
||||
const revealProcess = useCallback(() => { turnProcess?.setOpen(true) }, [turnProcess])
|
||||
// Relative destinations name files in the directory that was current when this message was written.
|
||||
const directory = useProjection('workingDirectoryHistory', history => directoryAt(history, node.anchorSeq))
|
||||
const resolvePath = useMemo(
|
||||
() => directory === undefined ? undefined : (path: string) => resolveWorkspacePath(directory, path),
|
||||
[directory],
|
||||
)
|
||||
return (
|
||||
<AssistantMarkdown
|
||||
blocks={data.blocks}
|
||||
@@ -70,7 +61,6 @@ export const AssistantNodeView = memo(function AssistantNodeView({
|
||||
renderSlot={renderSlot}
|
||||
revealProcess={revealProcess}
|
||||
mentions={mentions}
|
||||
resolvePath={resolvePath}
|
||||
t={t}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -6,7 +6,6 @@ import type {
|
||||
NodeKey, RenderEntry,
|
||||
} from '@deepseek-ai/dsh-client-ui-conversation/client'
|
||||
import type { InboxState } from '@deepseek-ai/dsh-agent/types'
|
||||
import type {} from '@deepseek-ai/dsh-working-directory/client'
|
||||
import type { PendingSubmission } from '@deepseek-ai/dsh-api-session-controller/client'
|
||||
import {
|
||||
Button, FenceCodeBlock, IconChevronDownOutlineRegular, MarkdownDelegateProvider, Modal,
|
||||
@@ -99,18 +98,16 @@ export function ChatView({
|
||||
)
|
||||
const inbox = useProjection('inbox') as InboxState | undefined
|
||||
// Workspace root off the session list row: path summaries display relative to it.
|
||||
const rootCwd = useSessions(s => s.byId[sessionId]?.cwd)
|
||||
// Images outside a message's path scope resolve like file links: from the current directory, else that root.
|
||||
const imageCwd = useProjection('workingDirectory') ?? rootCwd
|
||||
const cwd = useSessions(s => s.byId[sessionId]?.cwd)
|
||||
const fileImages = useMemo(() => ({
|
||||
fileDrag,
|
||||
resolve: (path: string) => fileMediaUrl(document.baseURI, resolveWorkspacePath(imageCwd, path)),
|
||||
resourceAddress: (path: string) => sessionFileAddress(sessionId, resolveWorkspacePath(imageCwd, path)),
|
||||
resolve: (path: string) => fileMediaUrl(document.baseURI, resolveWorkspacePath(cwd, path)),
|
||||
resourceAddress: (path: string) => sessionFileAddress(sessionId, resolveWorkspacePath(cwd, path)),
|
||||
labels: {
|
||||
open: t('image.open'), loading: t('image.loading'), failed: t('image.failed'),
|
||||
dialog: t('image.dialog'), close: t('image.close'),
|
||||
},
|
||||
}), [imageCwd, t, fileDrag, sessionId])
|
||||
}), [cwd, t, fileDrag, sessionId])
|
||||
const codeLabels = useMemo(() => markdownLabels(t).code, [t])
|
||||
// Every fence in the flow dispatches by language; the content is the plain
|
||||
// code block, so a language without a layer renders as code without diff rows.
|
||||
@@ -283,7 +280,7 @@ export function ChatView({
|
||||
>
|
||||
{renderSlot('conversation.chat.flow', {
|
||||
entries, pendingInputs, lastInputTurn, deferCollapse,
|
||||
cwd: rootCwd, openFile: requestOpenFile, inspectCall, forkAt, loadImage,
|
||||
cwd, openFile: requestOpenFile, inspectCall, forkAt, loadImage,
|
||||
}, { hookContext: flowContext })}
|
||||
</MarkdownDelegateProvider>
|
||||
<div ref={interactionSurfaceRef} className={css.textInteraction} data-text-interaction-surface=""
|
||||
|
||||
Loaded 100 of 300 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user