diff --git a/.github/workflows/compat.yml b/.github/workflows/compat.yml index 5a7b44b..f4c630f 100644 --- a/.github/workflows/compat.yml +++ b/.github/workflows/compat.yml @@ -1,6 +1,6 @@ name: Compat -# dshbase-style compatibility verification (monthly + on demand): +# dshbase-style compatibility verification (weekly + per PR + on demand): # 1. bare-import: install the packed tarball into an empty project (native # builds allowlisted) and import its entry - catches devDependencies # mistaken for dependencies and native-build gate regressions. @@ -13,8 +13,9 @@ name: Compat # Platform guard: every assertion here is platform-neutral. Platform-specific # behavior (Windows/macOS-only rows) is never asserted on this Linux runner. on: + pull_request: schedule: - - cron: '0 4 1 * *' + - cron: '0 4 * * 1' workflow_dispatch: jobs: @@ -81,7 +82,7 @@ jobs: pnpm run build pnpm pack --pack-destination "$RUNNER_TEMP" - name: Install dsh CLI - run: npm install -g @deepseek-ai/dsh@0.1.5-rc.2 + run: npm install -g @deepseek-ai/dsh@0.1.6-alpha.2 - name: Install into a scratch profile (builds allowlisted) run: | @@ -93,6 +94,7 @@ jobs: packages: - . nodeLinker: hoisted + minimumReleaseAge: 0 autoInstallPeers: false allowBuilds: '@deepseek-ai/dsh-subprocess-local': true @@ -101,7 +103,7 @@ jobs: protobufjs: true '@google/genai': true YAML - dsh plugin --profile compat add '@deepseek-ai/dsh-base@0.1.5-rc.2' '@deepseek-ai/dsh-headless@0.1.5-rc.2' "$TARBALL" + dsh plugin --profile compat add '@deepseek-ai/dsh-base@0.1.6-alpha.2' '@deepseek-ai/dsh-headless@0.1.6-alpha.2' "$TARBALL" - name: Row-mount assertion run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 77f6aa9..2391108 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,21 @@ All notable changes to this project are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Move the settings card from the Settings→plugins tab to the **Plugins page** (Official group): the `0.1.6-alpha.2` host deletes the `settings.plugin.item` slot, so the card registered there silently disappears. The card now registers on the keyed `plugins.item` slot (`id: dsh-github`, `order: 100`, `label` as a function, `locale`) and renders one component in two states — a one-line summary (description + token badge) and the full editable form (`view: 'summary' | 'page'`) — with the built `lib/client.js` rebuilt and committed. +- Default the CI composite action model to `deepseek-flash`: the `deepseek-v4-flash` id the action, its patch script, and the local test script referenced is removed from the harness catalog, which would silently downgrade GitHub Actions users to a text-only model. +- Drive the CI review bot's polling through `ctx.jobs.start` (kind `github-ci`) instead of `setInterval`, with a one-time-warn `setInterval` fallback when no job controller serves the agent. +- Auto-approve CI-driver writes through the official policy seam: `ctx.approval.setPolicy(agent, 'never')` pins the calling agent instead of the previous gate-only bypass. +- Consume the official `@deepseek-ai/dsh-jobs` (`JobId`, `JobStart`, `JobHooks`, `JobOutcome`, `JobSnapshot`, `JobRegistry`) and `@deepseek-ai/dsh-subagent` (`SubagentRun`, `SubagentStartRequest`) type faces instead of the hand-copied mirrors, and drop the plugin's own `subagents` context augmentation (the official package augments it). +- Declare `dshWorkshop.manifestVersion: 1` and the `engines.dsh` range `>=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0` (the added third clause keeps the `0.1.6` alpha line accepted). + +### Fixed + +- Close the type gate over the client half: `src/client.ts` is no longer excluded from `tsconfig.json` (react dev deps and the DOM lib added), and the new `tsconfig.ci.json` + `typecheck:ci` ruler covers the published line. The `lib/client.d.ts` / `lib/client.d.ts.map` / `lib/client.js.map` build artifacts are now committed alongside `lib/client.js`. + ## [0.7.10] - 2026-09-12 ### Changed diff --git a/README-es.md b/README-es.md index 0ba3762..286ecd1 100644 --- a/README-es.md +++ b/README-es.md @@ -46,7 +46,7 @@ | Superficie | Estado | |---|---| -| Harness | DeepSeek Harness `dsh-v0.1.5-rc.2` (compatibilidad declarada para `0.1.5-rc.2`) 0.1.2-rc.1 (adaptado el 2026-09-09): el sobre de sesión conserva su campo ignorable solo para compatibilidad de lectura de logs almacenados - Session.append aún no puede estamparlo, por lo que el comportamiento de la puerta no cambia. Verificado el 2026-09-11 contra el checkout master de dsh-v0.1.5-rc.2 (cadena de puertas completa + smoke de instalación de profile). | +| Harness | DeepSeek Harness `dsh-v0.1.6-alpha.2` (compatibilidad declarada para `>=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0`; 0.1.2-rc.1 adaptado el 2026-09-09): la tarjeta de configuración ahora se registra en la **página Plugins** (grupo Official, slot `plugins.item`) en lugar de la pestaña eliminada Settings→plugins; el controlador de CI autoaprueba mediante la costura oficial `ctx.approval.setPolicy`; el bot de revisión sondea como tarea en segundo plano `ctx.jobs` con respaldo por temporizador. Actualizado en lote el 2026-09-18 (typecheck + typecheck:ci + 183 pruebas unitarias en verde). | | Node | `^22.19.0 \|\| >=24.0.0` | | Plataformas | Todas (plugin host; red saliente a GitHub) | | Modelo | Cualquiera (la revisión estática es determinista; `reviewMode: "model"` es opcional) | @@ -87,7 +87,7 @@ dsh --profile web --dump-config | grep -A3 'id: dsh-github' ## Configuración -Todos los ajustes son campos `Config` de Schemastery (modificables desde cordis.yml). Una anulación dirigida por id reemplaza toda la fila — vuelve a indicar cada clave que necesites. `cordis.patch.yml` documenta cada clave en línea. +Todos los ajustes son campos `Config` de Schemastery (modificables desde cordis.yml). Una anulación dirigida por id reemplaza toda la fila — vuelve a indicar cada clave que necesites. `cordis.patch.yml` documenta cada clave en línea. En la GUI, esas mismas claves se editan en la **tarjeta de configuración de la página Plugins** (grupo Official) — la tarjeta se movió allí desde la pestaña Settings→plugins, que el host `0.1.6-alpha.2` ya no declara. | Clave | Por defecto | Significado | |---|---|---| diff --git a/README-hi.md b/README-hi.md index 1d3fce8..ebcb4fb 100644 --- a/README-hi.md +++ b/README-hi.md @@ -46,7 +46,7 @@ | सतह | स्थिति | |---|---| -| Harness | DeepSeek Harness `dsh-v0.1.5-rc.2` (`0.1.5-rc.2` के लिए compat घोषित) 0.1.2-rc.1 (2026-09-09 को अनुकूलित): सत्र लिफ़ाफ़ा अपना ignorable फ़ील्ड केवल संग्रहीत-लॉग पठन संगतता के लिए रखता है - Session.append अभी भी इसे स्टैम्प नहीं कर सकता, इसलिए गेट व्यवहार अपरिवर्तित है। 2026-09-11 को dsh-v0.1.5-rc.2 master checkout के विरुद्ध सत्यापित (पूर्ण गेट श्रृंखला + profile इंस्टॉल smoke)। | +| Harness | DeepSeek Harness `dsh-v0.1.6-alpha.2` (`>=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0` के लिए compat घोषित; 0.1.2-rc.1 2026-09-09 को अनुकूलित): settings card अब **Plugins पेज** (Official समूह, `plugins.item` slot) पर पंजीकृत होता है, हटाए गए Settings→plugins टैब की जगह; CI driver आधिकारिक `ctx.approval.setPolicy` नीति सीम से ऑटो-अनुमोदन करता है; review bot `ctx.jobs` पृष्ठभूमि job के रूप में टाइमर फ़ॉलबैक के साथ पोल करता है। 2026-09-18 को बैच-अपग्रेड किया गया (typecheck + typecheck:ci + 183 यूनिट टेस्ट हरे)। | | Node | `^22.19.0 \|\| >=24.0.0` | | Platforms | सभी (host plugin; GitHub की ओर outbound network) | | Model | कोई भी (static review deterministic है; `reviewMode: "model"` वैकल्पिक है) | @@ -87,7 +87,7 @@ dsh --profile web --dump-config | grep -A3 'id: dsh-github' ## कॉन्फ़िगरेशन -सभी tunables Schemastery `Config` fields हैं (cordis.yml से बदले जा सकते हैं)। एक id-लक्षित override पूरी row को बदल देता है — जो key आपको चाहिए उसे दोबारा लिखें। `cordis.patch.yml` हर key को inline दस्तावेज़ित करता है। +सभी tunables Schemastery `Config` fields हैं (cordis.yml से बदले जा सकते हैं)। एक id-लक्षित override पूरी row को बदल देता है — जो key आपको चाहिए उसे दोबारा लिखें। `cordis.patch.yml` हर key को inline दस्तावेज़ित करता है। GUI में, वही keys **Plugins पेज settings card** (Official समूह) के ज़रिए संपादित होती हैं — कार्ड Settings→plugins टैब से यहाँ ले जाया गया है, क्योंकि `0.1.6-alpha.2` host उस slot को अब declare नहीं करता। | कुंजी | डिफ़ॉल्ट | अर्थ | |---|---|---| diff --git a/README-pt.md b/README-pt.md index ef1aea0..ea92380 100644 --- a/README-pt.md +++ b/README-pt.md @@ -46,7 +46,7 @@ | Superfície | Status | |---|---| -| Harness | DeepSeek Harness `dsh-v0.1.5-rc.2` (compatibilidade declarada para `0.1.5-rc.2`) 0.1.2-rc.1 (adaptado em 2026-09-09): o envelope de sessão mantém seu campo ignorable apenas para compatibilidade de leitura de logs armazenados - o Session.append ainda não consegue estampá-lo, então o comportamento da porta não muda. Verificado em 2026-09-11 contra o checkout master do dsh-v0.1.5-rc.2 (cadeia de portas completa + smoke de instalação de profile). | +| Harness | DeepSeek Harness `dsh-v0.1.6-alpha.2` (compatibilidade declarada para `>=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0`; 0.1.2-rc.1 adaptado em 2026-09-09): o cartão de configurações agora se registra na **página Plugins** (grupo Official, slot `plugins.item`) em vez da aba removida Settings→plugins; o driver de CI autoaprova pela costura oficial `ctx.approval.setPolicy`; o bot de revisão pesquisa como job em segundo plano `ctx.jobs` com fallback por temporizador. Atualizado em lote em 2026-09-18 (typecheck + typecheck:ci + 183 testes unitários verdes). | | Node | `^22.19.0 \|\| >=24.0.0` | | Plataformas | Todas (plugin host; rede de saída para o GitHub) | | Modelo | Qualquer (a revisão estática é determinística; `reviewMode: "model"` é opcional) | @@ -87,7 +87,7 @@ dsh --profile web --dump-config | grep -A3 'id: dsh-github' ## Configuração -Todos os ajustes são campos `Config` do Schemastery (modificáveis a partir do cordis.yml). Uma substituição direcionada por id troca toda a linha — redeclare cada chave de que você precisa. O `cordis.patch.yml` documenta cada chave em linha. +Todos os ajustes são campos `Config` do Schemastery (modificáveis a partir do cordis.yml). Uma substituição direcionada por id troca toda a linha — redeclare cada chave de que você precisa. O `cordis.patch.yml` documenta cada chave em linha. Na GUI, as mesmas chaves são editáveis pelo **cartão de configurações da página Plugins** (grupo Official) — o cartão foi movido para lá a partir da aba Settings→plugins, que o host `0.1.6-alpha.2` não declara mais. | Chave | Padrão | Significado | |---|---|---| diff --git a/README-zh.md b/README-zh.md index a4f05cf..54884c7 100644 --- a/README-zh.md +++ b/README-zh.md @@ -48,7 +48,7 @@ | 界面 | 状态 | |---|---| -| Harness | DeepSeek Harness `dsh-v0.1.5-rc.2`(兼容声明覆盖 `0.1.5-rc.2`) 0.1.2-rc.1(2026-09-09 已适配):会话信封保留 ignorable 字段但仅用于存量日志读取兼容——Session.append 仍无法盖章,门控行为不变。 2026-09-11 已对照 dsh-v0.1.5-rc.2 master checkout 核验(完整门禁链 + profile 安装冒烟)。 | +| Harness | DeepSeek Harness `dsh-v0.1.6-alpha.2`(兼容声明覆盖 `>=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0`;0.1.2-rc.1 于 2026-09-09 已适配):设置卡现注册在 **Plugins 页**(Official 组,`plugins.item` 槽),不再使用已删除的 Settings→插件 tab;CI 驱动器通过官方 `ctx.approval.setPolicy` 策略缝自动放行;评审机器人以 `ctx.jobs` 后台任务轮询,并带定时器降级。批量升级于 2026-09-18(typecheck + typecheck:ci + 183 项单元测试全绿)。 | | Node | `^22.19.0 \|\| >=24.0.0` | | Platforms | 全部(host 插件;出站网络访问 GitHub) | | Model | 任意(静态审查是确定性的;`reviewMode: "model"` 为可选) | @@ -89,7 +89,7 @@ dsh --profile web --dump-config | grep -A3 'id: dsh-github' ## 配置 -所有可调项都是 Schemastery `Config` 字段(可从 cordis.yml 修改)。以 id 定位的覆盖会替换整行 —— 需要重新声明你所需的每个键。`cordis.patch.yml` 逐键内联说明。 +所有可调项都是 Schemastery `Config` 字段(可从 cordis.yml 修改)。以 id 定位的覆盖会替换整行 —— 需要重新声明你所需的每个键。`cordis.patch.yml` 逐键内联说明。在图形界面中,同一批键可在 **Plugins 页设置卡**(Official 组)中编辑——该卡已从 Settings→插件 tab 迁出(`0.1.6-alpha.2` 宿主不再声明该槽)。 | 键 | 默认值 | 含义 | |---|---|---| diff --git a/README.md b/README.md index eb36ac0..ac3fedd 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ | Surface | Status | |---|---| -| Harness | DeepSeek Harness `dsh-v0.1.5-rc.2` (compat declared for `>=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0`; 0.1.2-rc.1 adapted 2026-09-09): the session envelope keeps its ignorable field for stored-log read compatibility only - Session.append still cannot stamp it, so audit-gate behavior is unchanged. Verified 2026-09-11 against the dsh-v0.1.5-rc.2 master checkout (full gate chain + profile install smoke). | +| Harness | DeepSeek Harness `dsh-v0.1.6-alpha.2` (compat declared for `>=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0`; 0.1.2-rc.1 adapted 2026-09-09): the settings card now registers on the **Plugins page** (Official group, `plugins.item` slot) instead of the removed Settings→plugins tab; the CI driver auto-approves through the official `ctx.approval.setPolicy` policy seam; the review bot polls as a `ctx.jobs` background job with a timer fallback. Batch-upgraded 2026-09-18 (typecheck + typecheck:ci + 183 unit tests green). | | Node | `^22.19.0 \|\| >=24.0.0` | | Platforms | All (host plugin; outbound network to GitHub) | | Model | Any (static review is deterministic; `reviewMode: "model"` is optional) | @@ -89,7 +89,7 @@ dsh --profile web --dump-config | grep -A3 'id: dsh-github' ## Configuration -All tunables are Schemastery `Config` fields (changeable from cordis.yml). An id-targeted override replaces the whole row — restate every key you need. `cordis.patch.yml` documents each key inline. +All tunables are Schemastery `Config` fields (changeable from cordis.yml). An id-targeted override replaces the whole row — restate every key you need. `cordis.patch.yml` documents each key inline. In the GUI, the same keys are editable through the **Plugins page settings card** (Official group) — the card moved there from the Settings→plugins tab, which the `0.1.6-alpha.2` host no longer declares. | Key | Default | Meaning | |---|---|---| diff --git a/action.yml b/action.yml index 3d5d0d6..0368540 100644 --- a/action.yml +++ b/action.yml @@ -36,7 +36,7 @@ inputs: model: description: 'DeepSeek model id for the headless session.' required: false - default: 'deepseek-v4-flash' + default: 'deepseek-flash' engine: description: "Review engine: 'static' (deterministic analyzer, zero review tokens) or 'model' (the agent authors the review body)." required: false diff --git a/lib/approval-gate.d.ts.map b/lib/approval-gate.d.ts.map index ad8a4dc..1e9648b 100644 --- a/lib/approval-gate.d.ts.map +++ b/lib/approval-gate.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"approval-gate.d.ts","sourceRoot":"","sources":["../src/approval-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAyF7C;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,IAAI,CAYjF"} \ No newline at end of file +{"version":3,"file":"approval-gate.d.ts","sourceRoot":"","sources":["../src/approval-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAIlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAyF7C;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,IAAI,CAiBjF"} \ No newline at end of file diff --git a/lib/approval-gate.js b/lib/approval-gate.js index c4a8f21..fa548d5 100644 --- a/lib/approval-gate.js +++ b/lib/approval-gate.js @@ -105,6 +105,12 @@ export function registerApprovalGate(ctx, state) { return { kind: 'deny', reason: `dsh-github: action "${action ?? exec.name}" is not in allowedActions` }; } if (state.isCiDriver && state.config.ci.autoApprove.includes(action)) { + // The CI driver bypasses the prompt through the official policy seam: + // pin the calling agent's policy to 'never' (auto-grant, no escalation) + // and allow the in-flight call. The runtime object is the host's Agent; + // GithubAgent is this plugin's minimal view of it. + if (exec.agent !== undefined) + ctx.approval.setPolicy(exec.agent, 'never'); return { kind: 'allow' }; } return { kind: 'ask', reason: `dsh-github: ${askReason(exec.name, argumentsAsRecord(exec), state)}` }; diff --git a/lib/approval-gate.js.map b/lib/approval-gate.js.map index cfc0dc5..a5e1ee0 100644 --- a/lib/approval-gate.js.map +++ b/lib/approval-gate.js.map @@ -1 +1 @@ -{"version":3,"file":"approval-gate.js","sourceRoot":"","sources":["../src/approval-gate.ts"],"names":[],"mappings":"AAmBA,MAAM,cAAc,GAAiC;IACnD,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,cAAc;IAC1B,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,QAAQ;CACjB,CAAA;AAED,uEAAuE;AACvE,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAA;AAExD,+EAA+E;AAC/E,SAAS,iBAAiB,CAAC,IAAmB;IAC5C,OAAO,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAoC,CAAC,CAAC,CAAC,EAAE,CAAA;AACvH,CAAC;AAED,gEAAgE;AAChE,SAAS,aAAa,CAAC,IAA6B;IAClD,MAAM,KAAK,GAAG,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAA;IACxE,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAA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No newline at end of file diff --git a/lib/ci/bot.d.ts.map b/lib/ci/bot.d.ts.map index 40443d5..ba432e7 100644 --- a/lib/ci/bot.d.ts.map +++ b/lib/ci/bot.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../../src/ci/bot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAoC,eAAe,EAAE,MAAM,aAAa,CAAA;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAG9C,gDAAgD;AAChD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,MAAM,CAAA;CACxB;AAOD,uDAAuD;AACvD,MAAM,WAAW,KAAK;IACpB,MAAM,IAAI,WAAW,CAAA;IACrB,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAC3C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IAClC,OAAO,IAAI,IAAI,CAAA;CAChB;AAID;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,IAAI,CAsJrG"} \ No newline at end of file +{"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../../src/ci/bot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAoC,eAAe,EAAc,MAAM,aAAa,CAAA;AAChG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAG9C,gDAAgD;AAChD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,MAAM,CAAA;CACxB;AAOD,uDAAuD;AACvD,MAAM,WAAW,KAAK;IACpB,MAAM,IAAI,WAAW,CAAA;IACrB,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAC3C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IAClC,OAAO,IAAI,IAAI,CAAA;CAChB;AAID;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,IAAI,CA6LrG"} \ No newline at end of file diff --git a/lib/ci/bot.js b/lib/ci/bot.js index db03b8b..9797411 100644 --- a/lib/ci/bot.js +++ b/lib/ci/bot.js @@ -95,13 +95,50 @@ export function registerCiBot(ctx, commands, state) { scanning = false; } }; - const timer = state.config.ci.pollIntervalMs > 0 - ? setInterval(() => { - if (polling) - void scan().catch(() => { }); - }, state.config.ci.pollIntervalMs) - : undefined; - timer?.unref?.(); + /** + * One polling tick; the scan loop owns its own concurrency guard. + */ + const tick = () => { + if (polling) + void scan().catch(() => { }); + }; + // The polling loop runs as a registry-owned background job (`github-ci-N`) + // so the jobs controller can see and stop it. When no job controller serves + // unowned work (the composition lacks tool-jobs), the registry's start + // refuses, and the loop degrades to the legacy interval — logged once. + let pollJobId; + let fallbackTimer; + let warnedFallback = false; + if (state.config.ci.pollIntervalMs > 0) { + const intervalMs = state.config.ci.pollIntervalMs; + try { + pollJobId = ctx.jobs.start({ + kind: 'github-ci', + label: 'dsh-github CI bot polling', + run: () => { + const timer = setInterval(tick, intervalMs); + timer.unref?.(); + let settle; + const done = new Promise((resolve) => { settle = resolve; }); + return { + cancel: (reason) => { + clearInterval(timer); + settle({ status: 'killed', detail: reason ?? 'polling disabled' }); + }, + done, + }; + }, + }); + } + catch (error) { + fallbackTimer = setInterval(tick, intervalMs); + fallbackTimer.unref?.(); + if (!warnedFallback) { + warnedFallback = true; + ctx.logger.warn(`dsh-github ci bot: no job controller serves the polling job (${error instanceof Error ? error.message : String(error)}); polling falls back to an interval. Load @deepseek-ai/dsh-tool-jobs to make the loop a visible job.`); + } + } + } const register = (name, description, hint, handler) => commands.register({ name, description, input: { hint }, handler }); const disposers = [ register('ci', 'CI review bot: scan PRs, publish reviews and the status-check gate', 'scan | status | start | stop | run ', async (invocation) => { @@ -159,8 +196,10 @@ export function registerCiBot(ctx, commands, state) { }), ]; return () => { - if (timer !== undefined) - clearInterval(timer); + if (pollJobId !== undefined) + ctx.jobs.kill(pollJobId, undefined, 'dsh-github dispose'); + if (fallbackTimer !== undefined) + clearInterval(fallbackTimer); for (const dispose of disposers) dispose(); }; diff --git a/lib/ci/bot.js.map b/lib/ci/bot.js.map index 1dd14e9..9aef027 100644 --- a/lib/ci/bot.js.map +++ b/lib/ci/bot.js.map @@ -1 +1 @@ -{"version":3,"file":"bot.js","sourceRoot":"","sources":["../../src/ci/bot.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AA2B7C,MAAM,QAAQ,GAAG,EAAE,CAAA;AAEnB;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,GAAY,EAAE,QAAyB,EAAE,KAAkB;IACvF,IAAI,OAAO,GAAG,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QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;iBAC3G,CAAA;YACH,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,2BAA2B,GAAG,uDAAuD,EAAE,CAAA;QACvH,CAAC,CAAC;KACH,CAAA;IAED,OAAO,GAAG,EAAE;QACV,IAAI,SAAS,KAAK,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,oBAAoB,CAAC,CAAA;QACtF,IAAI,aAAa,KAAK,SAAS;YAAE,aAAa,CAAC,aAAa,CAAC,CAAA;QAC7D,KAAK,MAAM,OAAO,IAAI,SAAS;YAAE,OAAO,EAAE,CAAA;IAC5C,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/lib/client.d.ts b/lib/client.d.ts new file mode 100644 index 0000000..f201af8 --- /dev/null +++ b/lib/client.d.ts @@ -0,0 +1,255 @@ +/** + * dsh-github browser half — one card in the "Plugins" settings section. + * + * The card edits the `dsh-github` settings namespace and lets the user fill + * the GitHub token directly from the settings page. The token literal never + * rides the settings document: it is written through the credentials domain, + * addressed by the reference the namespace names (`tokenRef`, default + * `GITHUB_TOKEN`), which is exactly where the host half resolves it — per + * operation, no restart needed. + * + * The card registers into the Plugins page's `plugins.item` list slot and + * renders the two views the page asks for: `summary` is the one-liner under + * the card's title, `page` is the form with its own save control. The page + * draws the title, icon, and crumb itself; buttons come from the shared + * primitives. + * + * The shipped `lib/client.js` is the __ModuleLoader__ bundle built from this + * module (plain ESM here; the bundle wraps it in the loader factory). The + * browser module loader executes that bundle, not this file. + * @module @perrylink/dsh-github/client + */ +import { type ReactNode } from 'react'; +/** + * The settings-namespace scope contract the card consumes, declared locally: + * the owning package differs across host lines (the removed + * `dsh-client-runtime` on `0.1.1-rc.2`, `dsh-client-ui-settings` on + * `0.1.2-alpha.1`), and the runtime contract is structural. Mirrors the + * owning seam's `SettingsScope`/`SettingsScopeSnapshot` faces. + */ +/** Client-side sync state of one settings namespace. */ +export interface SettingsScopeSnapshot { + /** `loading` until the first accepted section, `ready` while one stands, `unavailable` otherwise. */ + status: 'loading' | 'ready' | 'unavailable'; + /** Last accepted schema-resolved section; undefined before the first acceptance. */ + value: T | undefined; + /** Composition layer the Host resolved the value over, when the owning plugin declared one. */ + base: unknown; + /** Raw user layer as stored, when one exists. */ + user: unknown; + /** Namespace revision fencing the next write; undefined before the first Host view. */ + revision: number | undefined; + /** Whether the Host document accepts writes; memory mode never does. */ + writable: boolean; + /** `host` syncs with the Host document; `memory` keeps a remote browser process-local. */ + mode: 'host' | 'memory'; +} +/** Reactive owner handle over one namespace's durable section. */ +export interface SettingsScope { + /** @returns the current sync snapshot (stable reference until the next change). */ + getSnapshot(): SettingsScopeSnapshot; + /** + * Observe snapshot replacements. + * @param listener - invoked after each snapshot change. + * @returns the disposer removing this listener. + */ + subscribe(listener: () => void): () => void; +} +/** + * Minimal writable snapshot store the card's slot hooks consume. Declared and + * implemented locally: its previous home `dsh-client-store` is not on the + * published `0.1.1-rc.2` line, and the card only needs the bare observable + * contract plus whole-value replacement (no drafts, no persistence) — the + * framework synthesizes the selector hook from `getSnapshot`/`subscribe`. + */ +export interface SnapshotStore { + /** @returns the current snapshot reference. */ + getSnapshot(): T; + /** + * Subscribe to snapshot replacements. + * @param listener - invoked after each change. + * @returns the disposer removing this listener. + */ + subscribe(listener: () => void): () => void; + /** + * Replace the state wholesale. + * @param next - next state. + */ + set(next: T): void; +} +/** + * Create the minimal card store. + * @param init - initial state. + * @returns the store. + */ +export declare function createSnapshotStore(init: T): SnapshotStore; +/** Namespace of the GitHub capability. Spelled here rather than imported: a client package must not depend on a Host package. */ +export declare const GITHUB_NS = "dsh-github"; +/** Credential reference the provider resolves when the section names none. */ +export declare const DEFAULT_TOKEN_REF = "GITHUB_TOKEN"; +/** Locale copy the card renders. */ +export interface GithubCardLocale { + githubTitle: string; + githubDescription: string; + tokenLabel: string; + tokenHint: string; + tokenSet: string; + tokenUnset: string; + unsaved: string; + readOnly: string; + save: string; + saving: string; + discard: string; + saveFailed: string; +} +/** English copy. */ +export declare const en: GithubCardLocale; +/** Simplified Chinese copy. */ +export declare const zh: GithubCardLocale; +/** The card's full state, as projected into its snapshot store. */ +export interface GithubCardState { + /** False while the namespace is not served to this client; the card renders nothing. */ + available: boolean; + /** Whether the Host settings document accepts writes. */ + writable: boolean; + /** Whether the referenced credential is configured. */ + configured: boolean; + /** Whether the credentials domain accepts writes. */ + credentialWritable: boolean; + /** Whether a save is crossing the wire. */ + saving: boolean; + /** Whether the last save did not land as staged. */ + failed: boolean; + /** The credential reference the card addresses. */ + ref: string; +} +/** Source and writability facts for one credential reference (never the value). */ +interface CredentialView { + /** Whether resolving the reference would currently return a value. */ + configured: boolean; + /** Source layer currently supplying the value; absent while unconfigured. */ + source?: string; + /** Whether the active provider can write this reference. */ + writable: boolean; +} +/** + * The credentials-domain wire face the card uses: the host `credentials` Remote + * namespace (`remote.credentials`). The token literal crosses the wire on + * `set` only — no read path returns it. + */ +export interface CredentialsApi { + /** + * Ask the credentials domain about references; one view per requested name, + * keyed by that name. + */ + describe(refs: string[]): Promise<{ + readonly ok: true; + readonly value: Record; + } | { + readonly ok: false; + readonly error: { + readonly code: string; + readonly message: string; + }; + }>; + /** + * Store one non-empty value under a reference. + */ + set(ref: string, value: string): Promise; +} +/** The section's settings value shape (subset of the Host schema). */ +interface GithubSettingsSection { + tokenRef?: string; +} +/** + * Bridges the `dsh-github` scope and the credentials domain onto the card. + * The token is the one control that does not live in the section: its literal + * never rides a response, so the card learns only whether one is configured + * and writes it through the credentials domain, addressed by the reference the + * section names. + */ +export declare class GithubCardController { + private readonly scope; + private readonly api; + private readonly store; + private saving; + private failed; + private credential; + constructor(scope: SettingsScope, api: CredentialsApi); + /** Project the card's full state for its snapshot store. */ + projection(): GithubCardState; + /** The credential reference the section names, or the provider default. */ + refOf(): string; + /** + * Ask the credentials domain about the reference the section names. A + * response is published only while it still answers for the reference in + * force, so two reads settling out of order cannot clobber each other. + */ + readCredential(): Promise; + /** + * Re-read after the Host reports a change to the reference this card + * watches — a token can be written from elsewhere, and the section does not + * change when it is. + * @param ref - the reference the Host reports as changed. + */ + refreshCredential(ref: string): void; + /** + * Write the staged token, then re-read whether the Host now holds one. A + * blank value writes nothing, which keeps the stored key. + * @param value - the staged credential literal. + * @returns whether the Host reports a configured credential afterwards. + */ + save(value: string): Promise; + /** Build the face the card's slot registration injects. */ + inject(): { + hooks: { + githubCard: SnapshotStore; + }; + submit: (value: string) => Promise; + }; + private publish; +} +/** Props the slot system injects into the card component. */ +export interface GithubCardProps { + t: (key: keyof GithubCardLocale) => string; + useGithubCard: (selector: (snapshot: GithubCardState) => GithubCardState) => GithubCardState; + submit: (value: string) => Promise; + /** The view the Plugins page asks for: the one-liner under the title, or the form. */ + view: 'summary' | 'page'; +} +/** + * Render the GitHub card. `summary` renders the one-liner the Plugins page + * places under the card's title (the description plus the token state badge); + * `page` renders the token control and the save/discard row on the plugin's + * own page. Renders nothing while the namespace is unavailable. + */ +export declare function GithubCard(props: GithubCardProps): ReactNode; +/** Dictionary namespace owned by this plugin. */ +export declare const NS = "dsh-github"; +/** Required services (cordis fiber inject). */ +export declare const inject: string[]; +export interface ClientContextLike { + get(service: string): unknown; + effect(disposer: () => void, label: string): void; + locale: { + bind(namespace: string): (key: keyof GithubCardLocale) => string; + register(namespace: string, dictionaries: Record): void; + }; + remote: { + $on(event: string, listener: (ref: string) => void): unknown; + credentials: CredentialsApi; + }; + settingsScope: { + bind(spec: { + namespace: string; + }): SettingsScope; + }; + slots: { + inject(slot: string, factory: () => unknown): unknown; + register(options: Record, component: unknown): unknown; + }; +} +/** Mount the GitHub configuration card into the Plugins page's Official group. */ +export declare function apply(ctx: ClientContextLike): void; +export {}; +//# sourceMappingURL=client.d.ts.map \ No newline at end of file diff --git a/lib/client.d.ts.map b/lib/client.d.ts.map new file mode 100644 index 0000000..498a131 --- /dev/null +++ b/lib/client.d.ts.map @@ -0,0 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5B,CAAA;IACD,aAAa,EAAE;QAAE,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;KAAE,CAAA;IACzE,KAAK,EAAE;QACL,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,GAAG,OAAO,CAAA;QACrD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAA;KACxE,CAAA;CACF;AAED,kFAAkF;AAClF,wBAAgB,KAAK,CAAC,GAAG,EAAE,iBAAiB,GAAG,IAAI,CAsBlD"} \ No newline at end of file diff --git a/lib/client.js b/lib/client.js index 3c4f131..42fa15e 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1,305 +1,261 @@ -window.__ModuleLoader__.load({ - id: "@perrylink/dsh-github", - factory: (require) => { - var module = { exports: {} }; - var exports = module.exports; - Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); - let react = require("react"); - let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives"); - //#region ../src/client.ts - /** - * dsh-github browser half — one card in the "Plugins" settings section. - * - * The card edits the `dsh-github` settings namespace and lets the user fill - * the GitHub token directly from the settings page. The token literal never - * rides the settings document: it is written through the credentials domain, - * addressed by the reference the namespace names (`tokenRef`, default - * `GITHUB_TOKEN`), which is exactly where the host half resolves it — per - * operation, no restart needed. - * - * The card is collapsible and mirrors the host's `PluginCard` chrome one for - * one (same design tokens, same layout), the way the market card does: the - * plugins tab only lays out a flex column and dispatches - * `settings.plugin.item`, so the container is ours to draw, but drawing it - * with the same tokens is what keeps it from looking like it wandered in from - * another product. Buttons and the chevron come from the shared primitives. - * - * The shipped `lib/client.js` is the __ModuleLoader__ bundle built from this - * module (plain ESM here; the bundle wraps it in the loader factory). The - * browser module loader executes that bundle, not this file. - * @module @perrylink/dsh-github/client - */ - /** - * Create the minimal card store. - * @param init - initial state. - * @returns the store. - */ - function createSnapshotStore(init) { - let state = init; - const listeners = /* @__PURE__ */ new Set(); - return { - getSnapshot: () => state, - subscribe: (listener) => { - listeners.add(listener); - return () => { - listeners.delete(listener); - }; - }, - set: (next) => { - state = next; - for (const listener of [...listeners]) listener(); - } - }; - } - /** Namespace of the GitHub capability. Spelled here rather than imported: a client package must not depend on a Host package. */ - const GITHUB_NS = "dsh-github"; - /** Credential reference the provider resolves when the section names none. */ - const DEFAULT_TOKEN_REF = "GITHUB_TOKEN"; - /** English copy. */ - const en = { - githubTitle: "GitHub", - githubDescription: "GitHub pull requests, issues, and CI through the agent.", - tokenLabel: "GitHub token", - tokenHint: "Stored in the credentials file, not here. Applied immediately; leave blank to keep the current token.", - tokenSet: "A token is configured.", - tokenUnset: "No token is configured; GitHub tools are unavailable until one is.", - unsaved: "Unsaved", - readOnly: "This deployment stores settings read-only.", - save: "Save", - saving: "Saving…", - discard: "Discard", - saveFailed: "The deployment did not accept this value; it was left for you to correct." - }; - /** Simplified Chinese copy. */ - const zh = { - githubTitle: "GitHub", - githubDescription: "通过 agent 操作 GitHub 的 PR、issue 与 CI。", - tokenLabel: "GitHub Token", - tokenHint: "写入凭证文件而非设置文件;保存后立即生效。留空表示保持现有令牌。", - tokenSet: "已配置令牌。", - tokenUnset: "未配置令牌;配置之前 GitHub 工具不可用。", - unsaved: "未保存", - readOnly: "本部署的设置为只读。", - save: "保存", - saving: "保存中…", - discard: "放弃修改", - saveFailed: "本部署没有接受该值,已保留供你修改。" - }; - /** - * Bridges the `dsh-github` scope and the credentials domain onto the card. - * The token is the one control that does not live in the section: its literal - * never rides a response, so the card learns only whether one is configured - * and writes it through the credentials domain, addressed by the reference the - * section names. - */ - var GithubCardController = class { - scope; - api; - store; - saving = false; - failed = false; - credential = { - ref: "", - configured: false, - writable: true - }; - constructor(scope, api) { - this.scope = scope; - this.api = api; - this.store = createSnapshotStore(this.projection()); - scope.subscribe(() => { - this.readCredential(); - this.publish(); - }); - this.readCredential(); - } - /** Project the card's full state for its snapshot store. */ - projection() { - const snapshot = this.scope.getSnapshot(); - return { - available: snapshot.status === "ready", - writable: snapshot.writable, - configured: this.credential.configured, - credentialWritable: this.credential.writable, - saving: this.saving, - failed: this.failed, - ref: this.credential.ref - }; - } - /** The credential reference the section names, or the provider default. */ - refOf() { - const declared = this.scope.getSnapshot().value?.tokenRef; - return declared !== void 0 && declared.length > 0 ? declared : DEFAULT_TOKEN_REF; - } - /** - * Ask the credentials domain about the reference the section names. A - * response is published only while it still answers for the reference in - * force, so two reads settling out of order cannot clobber each other. - */ - async readCredential() { - const ref = this.refOf(); - if (ref !== this.credential.ref) { - this.credential = { - ref, - configured: false, - writable: true - }; - this.publish(); - } - let response; - try { - response = await this.api.describe([ref]); - } catch { - return; - } - if (!response.ok || ref !== this.refOf()) return; - const view = response.value[ref]; - const next = { - ref, - configured: view?.configured ?? false, - writable: view?.writable ?? true - }; - if (next.configured === this.credential.configured && next.writable === this.credential.writable) return; - this.credential = next; - this.publish(); - } - /** - * Re-read after the Host reports a change to the reference this card - * watches — a token can be written from elsewhere, and the section does not - * change when it is. - * @param ref - the reference the Host reports as changed. - */ - refreshCredential(ref) { - if (ref !== this.credential.ref) return; - this.readCredential(); - } - /** - * Write the staged token, then re-read whether the Host now holds one. A - * blank value writes nothing, which keeps the stored key. - * @param value - the staged credential literal. - * @returns whether the Host reports a configured credential afterwards. - */ - async save(value) { - const text = (value ?? "").trim(); - if (text === "" || this.saving) return false; - this.saving = true; - this.failed = false; - this.publish(); - try { - await this.api.set(this.refOf(), text); - } catch {} - await this.readCredential(); - const landed = this.credential.configured; - this.saving = false; - this.failed = !landed; - this.publish(); - return landed; - } - /** Build the face the card's slot registration injects. */ - inject() { - return { - hooks: { githubCard: this.store }, - submit: (value) => this.save(value) - }; - } - publish() { - this.store.set(this.projection()); - } - }; - /** One class name builder (static strings only — no bundler CSS modules here). */ - const cx = (...parts) => parts.filter(Boolean).join(" "); - /** - * Render the GitHub card: a collapsible header naming the plugin, and — once - * expanded — the token control and the save/discard row. Renders nothing - * while the namespace is unavailable. - */ - function GithubCard(props) { - const { t } = props; - const state = props.useGithubCard((snapshot) => snapshot); - const [open, setOpen] = (0, react.useState)(false); - const [draft, setDraft] = (0, react.useState)(""); - if (!state.available) return null; - const title = t("githubTitle"); - const dirty = draft.trim() !== ""; - const saveLabel = state.saving ? t("saving") : t("save"); - return (0, react.createElement)("li", { className: cx("ghc-card", open && "ghc-cardOpen") }, (0, react.createElement)("button", { - type: "button", - className: "ghc-header", - "aria-expanded": open, - "aria-label": `${open ? "Collapse" : "Expand"}: ${title}`, - onClick: () => setOpen(!open) - }, (0, react.createElement)("span", { className: "ghc-headText" }, (0, react.createElement)("span", { className: "ghc-name" }, title), (0, react.createElement)("span", { className: "ghc-description" }, t("githubDescription"))), dirty ? (0, react.createElement)("span", { className: "ghc-pending" }, t("unsaved")) : null, (0, react.createElement)("span", { className: cx("ghc-chevron", open && "ghc-chevronOpen") }, (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { size: 14 }))), open ? (0, react.createElement)("div", { className: "ghc-body" }, !state.writable ? (0, react.createElement)("p", { - className: "ghc-readOnly", - role: "status" - }, t("readOnly")) : null, (0, react.createElement)("div", { className: "ghc-field" }, (0, react.createElement)("div", { className: "ghc-head" }, (0, react.createElement)("label", { - className: "ghc-label", - htmlFor: "plugin-config-github-token" - }, t("tokenLabel")), (0, react.createElement)("span", { className: "ghc-badges" }, (0, react.createElement)("span", { className: state.configured ? "ghc-badge" : "ghc-badgeMuted" }, state.configured ? t("tokenSet") : t("tokenUnset")))), (0, react.createElement)("input", { - id: "plugin-config-github-token", - className: "ghc-input", - type: "password", - autoComplete: "off", - value: draft, - disabled: !state.credentialWritable, - onChange: (event) => setDraft(event.target.value) - }), (0, react.createElement)("p", { className: "ghc-hint" }, t("tokenHint"))), (0, react.createElement)("div", { className: "ghc-actions" }, state.failed ? (0, react.createElement)("p", { - className: "ghc-failed", - role: "status" - }, t("saveFailed")) : null, (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, { - variant: "ghost", - size: "sm", - disabled: !dirty || state.saving, - onClick: () => setDraft("") - }, t("discard")), (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, { - variant: "primary", - size: "sm", - disabled: !state.writable || !dirty || state.saving, - icon: state.saving ? (0, react.createElement)("span", { className: "ghc-spin" }, (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconLoadingOutline16, { size: 16 })) : void 0, - onClick: async () => { - if (await props.submit(draft)) setDraft(""); - } - }, saveLabel))) : null); - } - /** Dictionary namespace owned by this plugin. */ - const NS = "dsh-github"; - /** Required services (cordis fiber inject). */ - const inject = [ - "slots", - "locale", - "connection", - "remote", - "settingsScope", - "remote.credentials" - ]; - /** Mount the GitHub configuration card into the plugins settings section. */ - function apply(ctx) { - ctx.locale.bind(NS); - ctx.effect(() => ctx.locale.register(NS, { - zh, - en - }), "dsh-github: card dictionaries"); - const github = new GithubCardController(ctx.settingsScope.bind({ namespace: NS }), ctx.remote.credentials); - ctx.effect(() => ctx.remote.$on("credentials/reference-updated", (ref) => github.refreshCredential(ref)), "dsh-github: credential invalidations"); - ctx.slots.inject("settings.plugin.item", function* () { - yield ctx.slots.register({ - name: "settings.plugin.item", - key: NS, - locale: NS, - inject: () => github.inject() - }, GithubCard); - }); - } - //#endregion - exports.DEFAULT_TOKEN_REF = DEFAULT_TOKEN_REF; - exports.GITHUB_NS = GITHUB_NS; - exports.GithubCard = GithubCard; - exports.GithubCardController = GithubCardController; - exports.NS = NS; - exports.apply = apply; - exports.createSnapshotStore = createSnapshotStore; - exports.en = en; - exports.inject = inject; - exports.zh = zh; - return module.exports; - } -}); +/** + * dsh-github browser half — one card in the "Plugins" settings section. + * + * The card edits the `dsh-github` settings namespace and lets the user fill + * the GitHub token directly from the settings page. The token literal never + * rides the settings document: it is written through the credentials domain, + * addressed by the reference the namespace names (`tokenRef`, default + * `GITHUB_TOKEN`), which is exactly where the host half resolves it — per + * operation, no restart needed. + * + * The card registers into the Plugins page's `plugins.item` list slot and + * renders the two views the page asks for: `summary` is the one-liner under + * the card's title, `page` is the form with its own save control. The page + * draws the title, icon, and crumb itself; buttons come from the shared + * primitives. + * + * The shipped `lib/client.js` is the __ModuleLoader__ bundle built from this + * module (plain ESM here; the bundle wraps it in the loader factory). The + * browser module loader executes that bundle, not this file. + * @module @perrylink/dsh-github/client + */ +import { createElement, useState } from 'react'; +import { Button, IconLoadingOutline16, } from '@deepseek-ai/dsh-client-ui-primitives'; +/** + * Create the minimal card store. + * @param init - initial state. + * @returns the store. + */ +export function createSnapshotStore(init) { + let state = init; + const listeners = new Set(); + return { + getSnapshot: () => state, + subscribe: (listener) => { + listeners.add(listener); + return () => { listeners.delete(listener); }; + }, + set: (next) => { + state = next; + for (const listener of [...listeners]) + listener(); + }, + }; +} +/** Namespace of the GitHub capability. Spelled here rather than imported: a client package must not depend on a Host package. */ +export const GITHUB_NS = 'dsh-github'; +/** Credential reference the provider resolves when the section names none. */ +export const DEFAULT_TOKEN_REF = 'GITHUB_TOKEN'; +/** English copy. */ +export const en = { + githubTitle: 'GitHub', + githubDescription: 'GitHub pull requests, issues, and CI through the agent.', + tokenLabel: 'GitHub token', + tokenHint: 'Stored in the credentials file, not here. Applied immediately; leave blank to keep the current token.', + tokenSet: 'A token is configured.', + tokenUnset: 'No token is configured; GitHub tools are unavailable until one is.', + unsaved: 'Unsaved', + readOnly: 'This deployment stores settings read-only.', + save: 'Save', + saving: 'Saving…', + discard: 'Discard', + saveFailed: 'The deployment did not accept this value; it was left for you to correct.', +}; +/** Simplified Chinese copy. */ +export const zh = { + githubTitle: 'GitHub', + githubDescription: '通过 agent 操作 GitHub 的 PR、issue 与 CI。', + tokenLabel: 'GitHub Token', + tokenHint: '写入凭证文件而非设置文件;保存后立即生效。留空表示保持现有令牌。', + tokenSet: '已配置令牌。', + tokenUnset: '未配置令牌;配置之前 GitHub 工具不可用。', + unsaved: '未保存', + readOnly: '本部署的设置为只读。', + save: '保存', + saving: '保存中…', + discard: '放弃修改', + saveFailed: '本部署没有接受该值,已保留供你修改。', +}; +/** + * Bridges the `dsh-github` scope and the credentials domain onto the card. + * The token is the one control that does not live in the section: its literal + * never rides a response, so the card learns only whether one is configured + * and writes it through the credentials domain, addressed by the reference the + * section names. + */ +export class GithubCardController { + scope; + api; + store; + saving = false; + failed = false; + credential = { ref: '', configured: false, writable: true }; + constructor(scope, api) { + this.scope = scope; + this.api = api; + this.store = createSnapshotStore(this.projection()); + scope.subscribe(() => { + void this.readCredential(); + this.publish(); + }); + void this.readCredential(); + } + /** Project the card's full state for its snapshot store. */ + projection() { + const snapshot = this.scope.getSnapshot(); + return { + available: snapshot.status === 'ready', + writable: snapshot.writable, + configured: this.credential.configured, + credentialWritable: this.credential.writable, + saving: this.saving, + failed: this.failed, + ref: this.credential.ref, + }; + } + /** The credential reference the section names, or the provider default. */ + refOf() { + const declared = this.scope.getSnapshot().value?.tokenRef; + return declared !== undefined && declared.length > 0 ? declared : DEFAULT_TOKEN_REF; + } + /** + * Ask the credentials domain about the reference the section names. A + * response is published only while it still answers for the reference in + * force, so two reads settling out of order cannot clobber each other. + */ + async readCredential() { + const ref = this.refOf(); + if (ref !== this.credential.ref) { + this.credential = { ref, configured: false, writable: true }; + this.publish(); + } + let response; + try { + response = await this.api.describe([ref]); + } + catch { + return; + } + if (!response.ok || ref !== this.refOf()) + return; + const view = response.value[ref]; + const next = { ref, configured: view?.configured ?? false, writable: view?.writable ?? true }; + if (next.configured === this.credential.configured && next.writable === this.credential.writable) + return; + this.credential = next; + this.publish(); + } + /** + * Re-read after the Host reports a change to the reference this card + * watches — a token can be written from elsewhere, and the section does not + * change when it is. + * @param ref - the reference the Host reports as changed. + */ + refreshCredential(ref) { + if (ref !== this.credential.ref) + return; + void this.readCredential(); + } + /** + * Write the staged token, then re-read whether the Host now holds one. A + * blank value writes nothing, which keeps the stored key. + * @param value - the staged credential literal. + * @returns whether the Host reports a configured credential afterwards. + */ + async save(value) { + const text = (value ?? '').trim(); + if (text === '' || this.saving) + return false; + this.saving = true; + this.failed = false; + this.publish(); + try { + await this.api.set(this.refOf(), text); + } + catch { + // handled below by re-reading the configured state + } + await this.readCredential(); + const landed = this.credential.configured; + this.saving = false; + this.failed = !landed; + this.publish(); + return landed; + } + /** Build the face the card's slot registration injects. */ + inject() { + return { + hooks: { githubCard: this.store }, + submit: (value) => this.save(value), + }; + } + publish() { + this.store.set(this.projection()); + } +} +/** + * Render the GitHub card. `summary` renders the one-liner the Plugins page + * places under the card's title (the description plus the token state badge); + * `page` renders the token control and the save/discard row on the plugin's + * own page. Renders nothing while the namespace is unavailable. + */ +export function GithubCard(props) { + const { t } = props; + const state = props.useGithubCard((snapshot) => snapshot); + const [draft, setDraft] = useState(''); + if (!state.available) + return null; + if (props.view === 'summary') { + return createElement('span', { className: 'ghc-summary' }, createElement('span', null, t('githubDescription')), createElement('span', { className: state.configured ? 'ghc-badge' : 'ghc-badgeMuted' }, state.configured ? t('tokenSet') : t('tokenUnset'))); + } + const dirty = draft.trim() !== ''; + const saveLabel = state.saving ? t('saving') : t('save'); + return createElement('div', { className: 'ghc-card ghc-cardPage' }, !state.writable + ? createElement('p', { className: 'ghc-readOnly', role: 'status' }, t('readOnly')) + : null, createElement('div', { className: 'ghc-field' }, createElement('div', { className: 'ghc-head' }, createElement('label', { className: 'ghc-label', htmlFor: 'plugin-config-github-token' }, t('tokenLabel')), createElement('span', { className: 'ghc-badges' }, createElement('span', { className: state.configured ? 'ghc-badge' : 'ghc-badgeMuted' }, state.configured ? t('tokenSet') : t('tokenUnset')))), createElement('input', { + id: 'plugin-config-github-token', + className: 'ghc-input', + type: 'password', + autoComplete: 'off', + value: draft, + disabled: !state.credentialWritable, + onChange: (event) => setDraft(event.target.value), + }), createElement('p', { className: 'ghc-hint' }, t('tokenHint'))), createElement('div', { className: 'ghc-actions' }, state.failed ? createElement('p', { className: 'ghc-failed', role: 'status' }, t('saveFailed')) : null, createElement(Button, { + variant: 'ghost', + size: 'sm', + disabled: !dirty || state.saving, + onClick: () => setDraft(''), + }, t('discard')), createElement(Button, { + variant: 'primary', + size: 'sm', + disabled: !state.writable || !dirty || state.saving, + icon: state.saving + ? createElement('span', { className: 'ghc-spin' }, createElement(IconLoadingOutline16, { size: 16 })) + : undefined, + onClick: async () => { + const landed = await props.submit(draft); + if (landed) + setDraft(''); + }, + }, saveLabel))); +} +/** Dictionary namespace owned by this plugin. */ +export const NS = 'dsh-github'; +/** Required services (cordis fiber inject). */ +export const inject = ['slots', 'locale', 'connection', 'remote', 'settingsScope', 'remote.credentials']; +/** Mount the GitHub configuration card into the Plugins page's Official group. */ +export function apply(ctx) { + const t = ctx.locale.bind(NS); + ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dsh-github: card dictionaries'); + const github = new GithubCardController(ctx.settingsScope.bind({ namespace: NS }), ctx.remote.credentials); + ctx.effect(() => ctx.remote.$on('credentials/reference-updated', (ref) => github.refreshCredential(ref)), 'dsh-github: credential invalidations'); + ctx.slots.inject('plugins.item', () => ctx.slots.register({ + name: 'plugins.item', + id: NS, + order: 100, + label: () => t('githubTitle'), + locale: NS, + inject: () => github.inject(), + }, GithubCard)); +} +//# sourceMappingURL=client.js.map \ No newline at end of file diff --git a/lib/client.js.map b/lib/client.js.map new file mode 100644 index 0000000..e04eca4 --- /dev/null +++ b/lib/client.js.map @@ -0,0 +1 @@ +{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAoC,MAAM,OAAO,CAAA;AACjF,OAAO,EACL,MAAM,EAAE,oBAAoB,GAC7B,MAAM,uCAAuC,CAAA;AA+D9C;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAI,IAAO;IAC5C,IAAI,KAAK,GAAG,IAAI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EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,+BAA+B,CAAC,CAAA;IACtF,MAAM,MAAM,GAAG,IAAI,oBAAoB,CACrC,GAAG,CAAC,aAAa,CAAC,IAAI,CAAwB,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,EAChE,GAAG,CAAC,MAAM,CAAC,WAAW,CACvB,CAAA;IACD,GAAG,CAAC,MAAM,CACR,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,+BAA+B,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAC7F,sCAAsC,CACvC,CAAA;IACD,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CACvD;QACE,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,EAAE;QACN,KAAK,EAAE,GAAG;QACV,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;QAC7B,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE;KAC9B,EACD,UAAU,CACX,CAAC,CAAA;AACJ,CAAC"} \ No newline at end of file diff --git a/lib/commands.d.ts.map b/lib/commands.d.ts.map index 2d8596f..1997e85 100644 --- a/lib/commands.d.ts.map +++ b/lib/commands.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,iBAAiB,EAAoC,eAAe,EAAe,WAAW,EAAE,MAAM,YAAY,CAAA;AAChI,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAiB7C,uCAAuC;AACvC,wBAAgB,iBAAiB,CAAC,QAAQ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EAAE,CAAA"} \ No newline at end of file diff --git a/lib/commands.js b/lib/commands.js index eab3164..4646dc2 100644 --- a/lib/commands.js +++ b/lib/commands.js @@ -93,7 +93,9 @@ export function registerReviewCommand(commands, jobs, state) { if (!state.records.has(jobId)) { return { kind: 'error', text: `no review job "${jobId}". List jobs with job_list or check the /review output.` }; } - const outcome = jobs.kill(jobId, invocation.agent, 'user requested stop via /review stop'); + const outcome = jobs.kill(jobId, + // The runtime object is the host's Agent; GithubAgent is this plugin's minimal view. + invocation.agent, 'user requested stop via /review stop'); return { kind: 'success', text: outcome === 'requested' ? `requested stop of job ${jobId}` : `job ${jobId} had already finished` }; } if (input.startsWith('post ')) { diff --git a/lib/commands.js.map b/lib/commands.js.map index 7e0a953..9048adb 100644 --- a/lib/commands.js.map +++ b/lib/commands.js.map @@ -1 +1 @@ -{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAI1C,MAAM,QAAQ,GAAG,2BAA2B,CAAA;AAC5C,MAAM,YAAY,GAAG,8GAA8G,CAAA;AACnI,MAAM,WAAW,GAAG,4BAA4B,CAAA;AAEhD,8EAA8E;AAC9E,SAAS,MAAM,CAAC,KAAkB,EAAE,IAAY;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IACzC,MAAM,OAAO,GAAG,iBAAiB,CAAC;QAChC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACjC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EA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M,CAAC,UAAU,CAAC,KAAK,EACrB,6BAA6B,KAAK,0DAA0D;kBAC1F,cAAc,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,mBAAmB,UAAU,CAAC,IAAI,oCAAoC;kBACzG,iDAAiD,CAAC,CAAA;YACtD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,yBAAyB,UAAU,CAAC,IAAI,8CAA8C,EAAE,CAAA;QAC1H,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,gBAAgB,CAAC,QAAyB,EAAE,IAAiB,EAAE,KAAkB;IAC/F,MAAM,SAAS,GAAG;QAChB,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC;QAClC,qBAAqB,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC;QAC5C,oBAAoB,CAAC,QAAQ,EAAE,KAAK,CAAC;KACtC,CAAA;IACD,OAAO,GAAG,EAAE;QACV,KAAK,MAAM,OAAO,IAAI,SAAS;YAAE,OAAO,EAAE,CAAA;IAC5C,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/lib/index.d.ts.map b/lib/index.d.ts.map index 42f1b0d..47fbbb6 100644 --- a/lib/index.d.ts.map +++ b/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAExC,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAWzD,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,IAAI,YAAY,EAAE,MAAM,aAAa,CAAA;AAEjE,eAAO,MAAM,IAAI,e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;GAOG;AACH,eAAO,MAAM,yBAAyB,eAAe,CAAA;AAIrD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;GAK/B,CAAA;AAEF,2DAA2D;AAC3D,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CACzB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE,UAAe,QAkCtF;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,QASvD"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index bda03c4..b52fc8c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -48,6 +48,9 @@ export const GithubSettingsSchema = z.object({ export function applyWithDeps(ctx, config, deps = {}) { // Consumer — the tool handlers consume the credentials service, the // optional subagents seam, and the git/gh runners assembled into `state`. + // The subagents seam is optional at runtime although the official type + // declares it non-optional; the cast through unknown keeps the plugin's + // minimal structural face (see types.ts). const state = createState({ credentials: ctx.credentials, subagents: ctx.get('subagents') }, config, deps.runGit ?? runGitCli, deps.runGh ?? runGhCli, deps.fetchImpl); // Service Provider — registers the GitHub tools on ctx.tools; the /pr // /review /issue /ci commands and the write-approval gate register through diff --git a/lib/index.js.map b/lib/index.js.map index 3b89b9e..2c7f000 100644 --- a/lib/index.js.map +++ b/lib/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgCA,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,SAAS,EAAkB,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAiB,MAA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wE;IACxE,sEAAsE;IACtE,kEAAkE;IAClE,4CAA4C;IAC5C,GAAG,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,WAAW,EAAE,EAAE;QACvC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,yBAAyB,EAAE,oBAAoB,CAAC,CAAA;IAChF,CAAC,CAAC,CAAA;AACJ,CAAC"} \ No newline at end of file diff --git a/lib/jobs.d.ts.map b/lib/jobs.d.ts.map index fe8b408..c0569a5 100644 --- a/lib/jobs.d.ts.map +++ b/lib/jobs.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../src/jobs.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAc,WAAW,EAAgB,MAAM,YAAY,CAAA;AACjG,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,YAAY,CAAA;AAE9D,mFAAmF;AACnF,eAAO,MAAM,eAAe,kBAAkB,CAAA;AAE9C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,WAAW,CAAA;IAClB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAWD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,mBAAmB,GAAG,WAAW,CAgCjH"} \ No newline at end of file +{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../src/jobs.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAc,WAAW,EAAgB,MAAM,YAAY,CAAA;AACjG,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,YAAY,CAAA;AAE9D,mFAAmF;AACnF,eAAO,MAAM,eAAe,kBAAkB,CAAA;AAE9C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,WAAW,CAAA;IAClB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAWD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,mBAAmB,GAAG,WAAW,CAkCjH"} \ No newline at end of file diff --git a/lib/jobs.js b/lib/jobs.js index 4e525ee..b33510c 100644 --- a/lib/jobs.js +++ b/lib/jobs.js @@ -51,6 +51,8 @@ export function startReviewJob(registry, state, input) { const spec = { kind: REVIEW_JOB_KIND, label: input.label, + // The runtime object is the host's Agent; GithubAgent is this plugin's + // documented minimal view of it (see types.ts). owner: input.owner, outputLimitBytes: 64 * 1024, run: () => runReviewWork(state, record, jobInput), diff --git a/lib/jobs.js.map b/lib/jobs.js.map index 28a5f54..ca399e2 100644 --- a/lib/jobs.js.map +++ b/lib/jobs.js.map @@ -1 +1 @@ -{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../src/jobs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,WAAW,EAAqB,MAAM,aAAa,CAAA;AAI5D,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,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;IAClD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,MAAM,CAAA;IACrE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,MAAM,CAAA;IACtK,OAAO,GAAG,IAAI,CAAC,MAAM,cAAc,OAAO,aAAa,MAAM,SAAS,CAAA;AACxE,CAAC;AAED,4EAA4E;AAC5E,SAAS,cAAc,CAAC,UAA2B,EAAE,YAAgC;IACnF,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAC3C,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAA;IAChD,CAAC;IACD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,CAAA;IACnD,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAA;AAChD,CAAC"} \ No newline at end of file diff --git a/lib/types.d.ts b/lib/types.d.ts index 9a0f693..ef484d3 100644 --- a/lib/types.d.ts +++ b/lib/types.d.ts @@ -9,6 +9,16 @@ * @module dsh-github/types */ import type { UserMessage } from '@deepseek-ai/dsh-llm/message'; +import type { JobId, JobStart } from '@deepseek-ai/dsh-jobs'; +import type { SubagentRun, SubagentStartRequest } from '@deepseek-ai/dsh-subagent'; +declare module '@deepseek-ai/dsh-jobs' { + interface JobKindMap { + /** The plugin's background review-job producer kind (`github-review-N` ids). */ + 'github-review': 'github-review'; + /** The plugin's CI polling job kind (`github-ci-N` ids). */ + 'github-ci': 'github-ci'; + } +} /** Minimal live-agent view: only the members dsh-github touches. */ export interface GithubAgent { /** Stable session-scoped id. */ @@ -53,49 +63,12 @@ export interface CommandDefinition { export interface CommandsService { register(definition: CommandDefinition): () => void; } -/** Registry-issued background-job id; the host generates `-N` strings. */ -export type GithubJobId = string & { - readonly __githubJobId: unique symbol; -}; -/** Terminal result a review-job producer supplies through its hooks. */ -export interface JobOutcome { - status: 'completed' | 'killed' | 'failed'; - detail?: string; - /** Final output for final-output-only jobs. */ - output?: string; -} -/** Producer hooks through which the job runtime controls the work. */ -export interface JobHooks { - cancel(reason?: string): void; - done: Promise; -} -/** Producer declaration passed to the job registry's start. */ -export interface JobStartSpec { - /** Producer kind — also the id prefix; the host treats kinds as opaque. */ - kind: string; - /** One-line model-facing label. */ - label: string; - outputLimitBytes?: number; - owner?: GithubAgent; - run(): JobHooks; -} -/** Read-only projection of one job. */ -export interface JobSnapshot { - id: string; - kind: string; - label: string; - status: 'running' | 'stopping' | 'completed' | 'killed' | 'failed'; - detail?: string; - startedAt: number; - finishedAt?: number; - reported: boolean; -} -/** Background-job registry subset used by dsh-github. */ -export interface JobRegistry { - start(spec: JobStartSpec): GithubJobId; - kill(id: string, caller?: GithubAgent, reason?: string): 'requested' | 'already-finished'; - get(id: string, caller?: GithubAgent): JobSnapshot; -} +/** Registry-issued background-job id (the official branded `JobId`). */ +export type GithubJobId = JobId; +/** Producer declaration passed to the job registry's start (official `JobStart`). */ +export type JobStartSpec = JobStart; +/** Re-export the official job seam faces the plugin consumes. */ +export type { JobHooks, JobOutcome, JobSnapshot, JobRegistry, } from '@deepseek-ai/dsh-jobs'; /** Closed approval outcomes; `allowed-once` is the only grant. */ export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable'; /** Readonly same-process permission question. */ @@ -109,39 +82,21 @@ export interface ApprovalRequest { /** Approval dispatch service subset used by dsh-github. */ export interface ApprovalService { request(req: ApprovalRequest): Promise; + /** Switch one live agent's policy; the CI driver pins `'never'` (auto-grant, no escalation). */ + setPolicy(agent: GithubAgent, policy: 'ask' | 'never'): void; } -/** Terminal result of one one-shot subagent run (model review). */ -export interface SubagentResultView { - readonly output: Array<{ - type: string; - text?: string; - }>; - readonly stopReason: string; -} -/** One-shot subagent run handle (model review). */ -export interface SubagentRunView { - readonly result: Promise; - dispose(): Promise; -} -/** Host subagent seam subset used by dsh-github's model review. */ +/** Host subagent seam subset used by dsh-github's model review: the official + * run/request faces, with the plugin's minimal agent view as the parent. */ export interface SubagentsService { list(): string[]; - start(name: string, request: { - label?: string; - prompt: Array<{ - type: 'text'; - text: string; - }>; + start(name: string, request: Omit & { parent: GithubAgent; - signal: AbortSignal; - }): Promise; + }): Promise; } declare module '@deepseek-ai/cordis' { interface Context { commands: CommandsService; - jobs: JobRegistry; approval: ApprovalService; - subagents?: SubagentsService; } } //# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/lib/types.d.ts.map b/lib/types.d.ts.map index 28f19a8..1dbbe3c 100644 --- a/lib/types.d.ts.map +++ b/lib/types.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAE/D,oEAAoE;AACpE,MAAM,WAAW,WAAW;IAC1B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,qEAAqE;IACrE,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;CACrC;AAED,sDAAsD;AACtD,MAAM,WAAW,iBA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AC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAC9B;AAED,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IACvD,gGAAgG;IAChG,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,GAAG,OAAO,GAAG,IAAI,CAAA;CAC7D;AAED;4EAC4E;AAC5E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,IAAI,MAAM,EAAE,CAAA;IAChB,KAAK,CACH,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,GAAG;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE,GACtE,OAAO,CAAC,WAAW,CAAC,CAAA;CACxB;AAED,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,QAAQ,EAAE,eAAe,CAAA;QACzB,QAAQ,EAAE,eAAe,CAAA;KAC1B;CACF"} \ No newline at end of file diff --git a/package.json b/package.json index b2df565..5e1565a 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "test": "vitest run", "test:coverage": "vitest run --coverage", "typecheck": "tsc --noEmit", + "typecheck:ci": "tsc -p tsconfig.ci.json --noEmit", "lint": "oxlint", "check:readmes": "node scripts/check-readmes.mjs", "verify:self-contained": "node scripts/verify-self-contained.mjs", @@ -60,10 +61,12 @@ "url": "https://github.com/PerryLink/dsh-github" }, "engines": { - "node": "^22.19.0 || >=24.0.0" + "node": "^22.19.0 || >=24.0.0", + "dsh": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0" }, "packageManager": "pnpm@11.7.0", "dsh": { + "manifestVersion": 1, "bundle": { "patch": "./cordis.patch.yml" }, @@ -119,14 +122,14 @@ }, "peerDependencies": { "@deepseek-ai/cordis": "^4.0.2", - "@deepseek-ai/dsh-client-ui-primitives": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0", - "@deepseek-ai/dsh-client-ui-settings": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0", - "@deepseek-ai/dsh-credentials": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0", - "@deepseek-ai/dsh-llm": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0", - "@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0", - "@deepseek-ai/dsh-settings": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0", - "@deepseek-ai/dsh-tool-jobs": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0", - "@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0", + "@deepseek-ai/dsh-client-ui-primitives": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0", + "@deepseek-ai/dsh-client-ui-settings": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0", + "@deepseek-ai/dsh-credentials": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0", + "@deepseek-ai/dsh-llm": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0", + "@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0", + "@deepseek-ai/dsh-settings": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0", + "@deepseek-ai/dsh-tool-jobs": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0", + "@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0", "react": "^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { @@ -146,14 +149,18 @@ "@deepseek-ai/cordis": "^4.0.2", "@deepseek-ai/cordis-plugin-loader": "^1.0.3", "@deepseek-ai/dsh-credentials": "0.1.5-rc.2", + "@deepseek-ai/dsh-jobs": "0.1.5-rc.2", "@deepseek-ai/dsh-llm": "0.1.5-rc.2", "@deepseek-ai/dsh-session": "0.1.5-rc.2", "@deepseek-ai/dsh-settings": "0.1.5-rc.2", + "@deepseek-ai/dsh-subagent": "0.1.5-rc.2", "@deepseek-ai/dsh-tools": "0.1.5-rc.2", "@deepseek-ai/schemastery": "^3.18.2", "@types/node": "^22.0.0", + "@types/react": "18.3.31", "@vitest/coverage-v8": "3.2.0", "oxlint": "0.18.1", + "react": "18.3.1", "typescript": "^5.7.0", "vitest": "^3.2.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13c59f5..164c14d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -516,16 +516,13 @@ importers: version: 0.1.1-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)) '@deepseek-ai/dsh-client-ui-settings': specifier: 0.1.1-rc.2 - version: 0.1.1-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-api-remotes@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/dsh-client-connection@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))(@deepseek-ai/dsh-client-runtime@0.1.1-rc.2(4c0be7f2cfbd8a98016187fda3745354))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-settings@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/schemastery@3.18.2)) + version: 0.1.1-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-api-remotes@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/dsh-client-connection@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))(@deepseek-ai/dsh-client-runtime@0.1.1-rc.2(a729c2da6ceb58efd0f352407f1d7173))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-settings@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/schemastery@3.18.2)) '@deepseek-ai/dsh-tool-jobs': specifier: 0.1.1-rc.2 - version: 0.1.1-rc.2(45ab5d679c6a253ac3987e8d3d773f71) + version: 0.1.1-rc.2(3d99476ca660af070ca3a99832cd10fb) '@deepseek-ai/schemastery': specifier: ^3.18.2 version: 3.18.2 - react: - specifier: ^18.0.0 || ^19.0.0 - version: 19.2.8 devDependencies: '@deepseek-ai/cordis': specifier: ^4.0.2 @@ -539,6 +536,9 @@ importers: '@deepseek-ai/dsh-credentials': specifier: 0.1.5-rc.2 version: 0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)) + '@deepseek-ai/dsh-jobs': + specifier: 0.1.5-rc.2 + version: 0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-agent@0.1.2-rc.1(7d3ede4742a83cb07b3ef08af190298f))(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))) '@deepseek-ai/dsh-llm': specifier: 0.1.5-rc.2 version: 0.1.5-rc.2(@deepseek-ai/cordis@4.0.2) @@ -548,6 +548,9 @@ importers: '@deepseek-ai/dsh-settings': specifier: 0.1.5-rc.2 version: 0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/schemastery@3.18.2) + '@deepseek-ai/dsh-subagent': + specifier: 0.1.5-rc.2 + version: 0.1.5-rc.2(b4ec1ec974f91438c73614b2e80f99ff) '@deepseek-ai/dsh-tools': specifier: 0.1.5-rc.2 version: 0.1.5-rc.2(9060655eaa706c5405b762406eafab51) @@ -557,12 +560,18 @@ importers: '@types/node': specifier: ^22.0.0 version: 22.20.1 + '@types/react': + specifier: 18.3.31 + version: 18.3.31 '@vitest/coverage-v8': specifier: 3.2.0 version: 3.2.0(vitest@3.2.7(@types/debug@4.1.13)(@types/node@22.20.1)) oxlint: specifier: 0.18.1 version: 0.18.1 + react: + specifier: 18.3.1 + version: 18.3.1 typescript: specifier: ^5.7.0 version: 5.9.3 @@ -693,6 +702,11 @@ packages: peerDependencies: '@deepseek-ai/cordis': ^4.0.2 + '@deepseek-ai/dsh-chunked-list@0.1.5-rc.2': + resolution: {integrity: sha512-XPr311bleMyOh9SzhTMmc1mC6qx2Tty8315MNYYyzIOLAns0h27PReFa9axy8I0soBaE7gfp6eQI1ZriVkI68g==} + peerDependencies: + '@deepseek-ai/cordis': ^4.0.2 + '@deepseek-ai/dsh-client-connection@0.1.2-rc.1': resolution: {integrity: sha512-30g7JG+Z8bDj+ux+KsDfMSXPI6zXotMAFNCxI8O8mJiutJNlZxIL5LXQeDrJpVOW9MWWQkoMp+R+Dxzp5DNDSQ==} peerDependencies: @@ -826,6 +840,15 @@ packages: '@deepseek-ai/dsh-invariants': 0.1.2-rc.1 '@deepseek-ai/dsh-session': 0.1.2-rc.1 + '@deepseek-ai/dsh-jobs@0.1.5-rc.2': + resolution: {integrity: sha512-C3rBEuWhtDBlxMeKykFvSfBwjSPxkLsvKCFq8BrFdjDmZC1lI9GooMjPZkPxXVbogVrcOBaYVtJdOYJ4+rIpQg==} + peerDependencies: + '@deepseek-ai/cordis': ^4.0.2 + '@deepseek-ai/dsh-agent': 0.1.2-rc.1 + '@deepseek-ai/dsh-brand': 0.1.2-rc.1 + '@deepseek-ai/dsh-invariants': 0.1.2-rc.1 + '@deepseek-ai/dsh-session': 0.1.2-rc.1 + '@deepseek-ai/dsh-llm-retry@0.1.2-rc.1': resolution: {integrity: sha512-WRpanzi4u2Z2X2uv/rwRZh5HTYUtd5smFTBMT4jYd1UpFOmjoMY/grDboZG9KI1OsgaS1vadiBJT4vvixFDEAA==} peerDependencies: @@ -1009,6 +1032,49 @@ packages: '@deepseek-ai/dsh-user-approval': optional: true + '@deepseek-ai/dsh-subagent@0.1.5-rc.2': + resolution: {integrity: sha512-f2wbfB1M2P8RpcApp5eDpDQR4V5ElvEkeK6su7tor1U06uJadJ+JuIVXP3MrCnT7yjg/IM2tTacYFMOg62BOfg==} + peerDependencies: + '@deepseek-ai/cordis': ^4.0.2 + '@deepseek-ai/dsh-agent': 0.1.2-rc.1 + '@deepseek-ai/dsh-agent-presets': 0.1.2-rc.1 + '@deepseek-ai/dsh-attachment': 0.1.2-rc.1 + '@deepseek-ai/dsh-invariants': 0.1.2-rc.1 + '@deepseek-ai/dsh-jobs': 0.1.2-rc.1 + '@deepseek-ai/dsh-llm': 0.1.2-rc.1 + '@deepseek-ai/dsh-sandbox': 0.1.2-rc.1 + '@deepseek-ai/dsh-sandbox-policy': 0.1.2-rc.1 + '@deepseek-ai/dsh-scope': 0.1.2-rc.1 + '@deepseek-ai/dsh-session': 0.1.2-rc.1 + '@deepseek-ai/dsh-session-persistence': 0.1.2-rc.1 + '@deepseek-ai/dsh-session-projection': 0.1.2-rc.1 + '@deepseek-ai/dsh-session-projection-cache': 0.1.2-rc.1 + '@deepseek-ai/dsh-session-query': 0.1.2-rc.1 + '@deepseek-ai/dsh-system-prompt': 0.1.2-rc.1 + '@deepseek-ai/dsh-tools': 0.1.2-rc.1 + '@deepseek-ai/dsh-typert-protocol': 0.1.2-rc.1 + '@deepseek-ai/dsh-user-approval': 0.1.2-rc.1 + '@deepseek-ai/dsh-util-time': 0.1.2-rc.1 + peerDependenciesMeta: + '@deepseek-ai/dsh-agent-presets': + optional: true + '@deepseek-ai/dsh-jobs': + optional: true + '@deepseek-ai/dsh-sandbox': + optional: true + '@deepseek-ai/dsh-sandbox-policy': + optional: true + '@deepseek-ai/dsh-session-persistence': + optional: true + '@deepseek-ai/dsh-session-projection': + optional: true + '@deepseek-ai/dsh-session-projection-cache': + optional: true + '@deepseek-ai/dsh-session-query': + optional: true + '@deepseek-ai/dsh-user-approval': + optional: true + '@deepseek-ai/dsh-system-prompt@0.1.2-rc.1': resolution: {integrity: sha512-7W93PZKIk4CHvjZGgLIxrrEKpk+6t8nQXje1vKR5vG73dfXH0t1MJ5WWH/fngadYc7c6KzM84ihQ66tJqJqyNQ==} peerDependencies: @@ -1565,6 +1631,12 @@ packages: '@types/node@22.20.1': resolution: {integrity: sha512-EANqOCF9QFyra+4pfxUcX9STKJpCLjMbObVzljIJomAWSnuSIEAvyzEU53GaajbXJEgdh0iEcPL+DGvpUd4k1Q==} + '@types/prop-types@15.7.15': + resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==} + + '@types/react@18.3.31': + resolution: {integrity: sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==} + '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} @@ -1698,6 +1770,9 @@ packages: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + debug@4.4.3: resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} engines: {node: '>=6.0'} @@ -2061,10 +2136,6 @@ packages: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} engines: {node: '>=0.10.0'} - react@19.2.8: - resolution: {integrity: sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==} - engines: {node: '>=0.10.0'} - regex-recursion@6.0.2: resolution: {integrity: sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==} @@ -2443,6 +2514,11 @@ snapshots: dependencies: '@deepseek-ai/cordis': 4.0.2(@deepseek-ai/cordis-plugin-include@1.0.7)(@deepseek-ai/cordis-plugin-loader@1.0.3) + '@deepseek-ai/dsh-chunked-list@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)': + dependencies: + '@deepseek-ai/cordis': 4.0.2(@deepseek-ai/cordis-plugin-include@1.0.7)(@deepseek-ai/cordis-plugin-loader@1.0.3) + zod: 4.5.4 + '@deepseek-ai/dsh-client-connection@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))': dependencies: '@deepseek-ai/cordis': 4.0.2(@deepseek-ai/cordis-plugin-include@1.0.7)(@deepseek-ai/cordis-plugin-loader@1.0.3) @@ -2452,7 +2528,7 @@ snapshots: transitivePeerDependencies: - '@deepseek-ai/dsh-invariants' - '@deepseek-ai/dsh-client-runtime@0.1.1-rc.2(4c0be7f2cfbd8a98016187fda3745354)': + '@deepseek-ai/dsh-client-runtime@0.1.1-rc.2(a729c2da6ceb58efd0f352407f1d7173)': dependencies: '@deepseek-ai/cordis': 4.0.2(@deepseek-ai/cordis-plugin-include@1.0.7)(@deepseek-ai/cordis-plugin-loader@1.0.3) '@deepseek-ai/dsh-agent': 0.1.2-rc.1(7d3ede4742a83cb07b3ef08af190298f) @@ -2471,7 +2547,7 @@ snapshots: '@deepseek-ai/dsh-typert-protocol': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) '@deepseek-ai/dsh-typert-registry': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) immer: 10.2.0 - zustand: 4.4.7(immer@10.2.0)(react@19.2.8) + zustand: 4.4.7(@types/react@18.3.31)(immer@10.2.0)(react@18.3.1) transitivePeerDependencies: - '@types/react' - react @@ -2503,12 +2579,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@deepseek-ai/dsh-client-ui-settings@0.1.1-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-api-remotes@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/dsh-client-connection@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))(@deepseek-ai/dsh-client-runtime@0.1.1-rc.2(4c0be7f2cfbd8a98016187fda3745354))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-settings@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/schemastery@3.18.2))': + '@deepseek-ai/dsh-client-ui-settings@0.1.1-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-api-remotes@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/dsh-client-connection@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))(@deepseek-ai/dsh-client-runtime@0.1.1-rc.2(a729c2da6ceb58efd0f352407f1d7173))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-settings@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/schemastery@3.18.2))': dependencies: '@deepseek-ai/cordis': 4.0.2(@deepseek-ai/cordis-plugin-include@1.0.7)(@deepseek-ai/cordis-plugin-loader@1.0.3) '@deepseek-ai/dsh-api-remotes': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))) '@deepseek-ai/dsh-client-connection': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)) - '@deepseek-ai/dsh-client-runtime': 0.1.1-rc.2(4c0be7f2cfbd8a98016187fda3745354) + '@deepseek-ai/dsh-client-runtime': 0.1.1-rc.2(a729c2da6ceb58efd0f352407f1d7173) '@deepseek-ai/dsh-invariants': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) '@deepseek-ai/dsh-settings': 0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/schemastery@3.18.2) '@deepseek-ai/schemastery': 3.18.2 @@ -2657,7 +2733,7 @@ snapshots: '@deepseek-ai/dsh-invariants': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) '@deepseek-ai/dsh-session': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))) - '@deepseek-ai/dsh-jobs@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-agent@0.1.2-rc.1(7d3ede4742a83cb07b3ef08af190298f))(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))': + '@deepseek-ai/dsh-jobs@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-agent@0.1.2-rc.1(7d3ede4742a83cb07b3ef08af190298f))(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))': dependencies: '@deepseek-ai/cordis': 4.0.2(@deepseek-ai/cordis-plugin-include@1.0.7)(@deepseek-ai/cordis-plugin-loader@1.0.3) '@deepseek-ai/dsh-agent': 0.1.2-rc.1(7d3ede4742a83cb07b3ef08af190298f) @@ -2861,6 +2937,32 @@ snapshots: '@deepseek-ai/dsh-session-query': 0.1.2-rc.1(58477e40250b29667ee6e2fb3e18344c) '@deepseek-ai/dsh-user-approval': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-agent@0.1.2-rc.1(7d3ede4742a83cb07b3ef08af190298f))(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-llm@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))(@deepseek-ai/dsh-session@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/dsh-system-prompt@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-llm@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))) + '@deepseek-ai/dsh-subagent@0.1.5-rc.2(b4ec1ec974f91438c73614b2e80f99ff)': + dependencies: + '@deepseek-ai/cordis': 4.0.2(@deepseek-ai/cordis-plugin-include@1.0.7)(@deepseek-ai/cordis-plugin-loader@1.0.3) + '@deepseek-ai/dsh-agent': 0.1.2-rc.1(7d3ede4742a83cb07b3ef08af190298f) + '@deepseek-ai/dsh-attachment': 0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)) + '@deepseek-ai/dsh-brand': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) + '@deepseek-ai/dsh-chunked-list': 0.1.5-rc.2(@deepseek-ai/cordis@4.0.2) + '@deepseek-ai/dsh-invariants': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) + '@deepseek-ai/dsh-llm': 0.1.5-rc.2(@deepseek-ai/cordis@4.0.2) + '@deepseek-ai/dsh-scope': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)) + '@deepseek-ai/dsh-session': 0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))) + '@deepseek-ai/dsh-system-prompt': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-llm@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))) + '@deepseek-ai/dsh-tools': 0.1.5-rc.2(9060655eaa706c5405b762406eafab51) + '@deepseek-ai/dsh-typert-protocol': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) + '@deepseek-ai/dsh-util-time': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) + '@deepseek-ai/dsh-util-values': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) + zod: 4.5.4 + optionalDependencies: + '@deepseek-ai/dsh-agent-presets': 0.1.2-rc.1(4c3dbaf98cf0e788f62a84edd41967ab) + '@deepseek-ai/dsh-jobs': 0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-agent@0.1.2-rc.1(7d3ede4742a83cb07b3ef08af190298f))(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))) + '@deepseek-ai/dsh-session-persistence': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/dsh-timeout@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)) + '@deepseek-ai/dsh-session-projection': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))) + '@deepseek-ai/dsh-session-projection-cache': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-session-projection@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-session@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))))(@deepseek-ai/dsh-session@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/dsh-storage-domain@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-storage@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))) + '@deepseek-ai/dsh-session-query': 0.1.2-rc.1(58477e40250b29667ee6e2fb3e18344c) + '@deepseek-ai/dsh-user-approval': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-agent@0.1.2-rc.1(7d3ede4742a83cb07b3ef08af190298f))(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-llm@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))))(@deepseek-ai/dsh-system-prompt@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-llm@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))) + '@deepseek-ai/dsh-system-prompt@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-llm@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))': dependencies: '@deepseek-ai/cordis': 4.0.2(@deepseek-ai/cordis-plugin-include@1.0.7)(@deepseek-ai/cordis-plugin-loader@1.0.3) @@ -2873,12 +2975,12 @@ snapshots: dependencies: '@deepseek-ai/cordis': 4.0.2(@deepseek-ai/cordis-plugin-include@1.0.7)(@deepseek-ai/cordis-plugin-loader@1.0.3) - '@deepseek-ai/dsh-tool-jobs@0.1.1-rc.2(45ab5d679c6a253ac3987e8d3d773f71)': + '@deepseek-ai/dsh-tool-jobs@0.1.1-rc.2(3d99476ca660af070ca3a99832cd10fb)': dependencies: '@deepseek-ai/cordis': 4.0.2(@deepseek-ai/cordis-plugin-include@1.0.7)(@deepseek-ai/cordis-plugin-loader@1.0.3) '@deepseek-ai/dsh-agent': 0.1.2-rc.1(7d3ede4742a83cb07b3ef08af190298f) '@deepseek-ai/dsh-invariants': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) - '@deepseek-ai/dsh-jobs': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-agent@0.1.2-rc.1(7d3ede4742a83cb07b3ef08af190298f))(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))) + '@deepseek-ai/dsh-jobs': 0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-agent@0.1.2-rc.1(7d3ede4742a83cb07b3ef08af190298f))(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))) '@deepseek-ai/dsh-llm': 0.1.5-rc.2(@deepseek-ai/cordis@4.0.2) '@deepseek-ai/dsh-output-retention': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) '@deepseek-ai/dsh-system-prompt': 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-llm@0.1.5-rc.2(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))) @@ -3278,6 +3380,13 @@ snapshots: dependencies: undici-types: 6.21.0 + '@types/prop-types@15.7.15': {} + + '@types/react@18.3.31': + dependencies: + '@types/prop-types': 15.7.15 + csstype: 3.2.3 + '@types/unist@3.0.3': {} '@ungap/structured-clone@1.4.0': {} @@ -3415,6 +3524,8 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 + csstype@3.2.3: {} + debug@4.4.3: dependencies: ms: 2.1.3 @@ -3991,8 +4102,6 @@ snapshots: dependencies: loose-envify: 1.4.0 - react@19.2.8: {} - regex-recursion@6.0.2: dependencies: regex-utilities: 2.3.0 @@ -4158,9 +4267,9 @@ snapshots: unist-util-is: 6.0.1 unist-util-visit-parents: 6.0.2 - use-sync-external-store@1.2.0(react@19.2.8): + use-sync-external-store@1.2.0(react@18.3.1): dependencies: - react: 19.2.8 + react: 18.3.1 vfile-message@4.0.3: dependencies: @@ -4270,11 +4379,12 @@ snapshots: zod@4.5.4: {} - zustand@4.4.7(immer@10.2.0)(react@19.2.8): + zustand@4.4.7(@types/react@18.3.31)(immer@10.2.0)(react@18.3.1): dependencies: - use-sync-external-store: 1.2.0(react@19.2.8) + use-sync-external-store: 1.2.0(react@18.3.1) optionalDependencies: + '@types/react': 18.3.31 immer: 10.2.0 - react: 19.2.8 + react: 18.3.1 zwitch@2.0.4: {} diff --git a/scripts/action-patch.mjs b/scripts/action-patch.mjs index c609865..9c642c0 100644 --- a/scripts/action-patch.mjs +++ b/scripts/action-patch.mjs @@ -34,7 +34,7 @@ const y = (value) => JSON.stringify(value) const task = env('INPUT_TASK').trim() || 'review' const pr = env('INPUT_PR').trim() const ownerRepo = env('INPUT_OWNER_REPO').trim() -const model = env('INPUT_MODEL').trim() || 'deepseek-v4-flash' +const model = env('INPUT_MODEL').trim() || 'deepseek-flash' const engine = env('INPUT_ENGINE').trim() === 'model' ? 'model' : 'static' const checkName = env('INPUT_CHECK_NAME').trim() || 'dsh-github-review' const blocking = boolOf(env('INPUT_BLOCKING'), true) diff --git a/scripts/local-test.mjs b/scripts/local-test.mjs index 9c7011f..3e86e20 100644 --- a/scripts/local-test.mjs +++ b/scripts/local-test.mjs @@ -38,7 +38,7 @@ Options: --pr Pull request number (required for review/fix-ci) --owner-repo Repository to review (required for review/fix-ci) --task-prompt Complete replacement for the default task text - --model Model for the headless session (default: deepseek-v4-flash) + --model Model for the headless session (default: deepseek-flash) --engine Review engine (default: static) --check-name Status-check name (default: dsh-github-review) --blocking Fail on needs-changes verdict (default: true) @@ -71,7 +71,7 @@ const options = { pr: '', ownerRepo: '', taskPrompt: '', - model: 'deepseek-v4-flash', + model: 'deepseek-flash', engine: 'static', checkName: 'dsh-github-review', blocking: 'true', diff --git a/src/approval-gate.ts b/src/approval-gate.ts index b2a3b18..1ff8c23 100644 --- a/src/approval-gate.ts +++ b/src/approval-gate.ts @@ -15,6 +15,7 @@ import type { Context } from '@deepseek-ai/cordis' import type { PreToolDecision, ToolExecution } from '@deepseek-ai/dsh-tools' import type { GithubAction } from './config.ts' +import type { GithubAgent } from './types.ts' import type { GithubState } from './state.ts' const ACTION_BY_TOOL: Record = { @@ -124,6 +125,11 @@ export function registerApprovalGate(ctx: Context, state: GithubState): () => vo return { kind: 'deny', reason: `dsh-github: action "${action ?? exec.name}" is not in allowedActions` } } if (state.isCiDriver && state.config.ci.autoApprove.includes(action)) { + // The CI driver bypasses the prompt through the official policy seam: + // pin the calling agent's policy to 'never' (auto-grant, no escalation) + // and allow the in-flight call. The runtime object is the host's Agent; + // GithubAgent is this plugin's minimal view of it. + if (exec.agent !== undefined) ctx.approval.setPolicy(exec.agent as unknown as GithubAgent, 'never') return { kind: 'allow' } } return { kind: 'ask', reason: `dsh-github: ${askReason(exec.name, argumentsAsRecord(exec), state)}` } diff --git a/src/ci/bot.ts b/src/ci/bot.ts index becac6a..59857ce 100644 --- a/src/ci/bot.ts +++ b/src/ci/bot.ts @@ -17,7 +17,7 @@ * @module dsh-github/ci/bot */ import type { Context } from '@deepseek-ai/cordis' -import type { CommandInvocation, CommandResult, CommandsService } from '../types.ts' +import type { CommandInvocation, CommandResult, CommandsService, JobOutcome } from '../types.ts' import type { GithubState } from '../state.ts' import { runCiPipeline } from './pipeline.ts' @@ -141,12 +141,50 @@ export function registerCiBot(ctx: Context, commands: CommandsService, state: Gi } } - const timer = state.config.ci.pollIntervalMs > 0 - ? setInterval(() => { - if (polling) void scan().catch(() => {}) - }, state.config.ci.pollIntervalMs) - : undefined - timer?.unref?.() + /** + * One polling tick; the scan loop owns its own concurrency guard. + */ + const tick = (): void => { + if (polling) void scan().catch(() => {}) + } + + // The polling loop runs as a registry-owned background job (`github-ci-N`) + // so the jobs controller can see and stop it. When no job controller serves + // unowned work (the composition lacks tool-jobs), the registry's start + // refuses, and the loop degrades to the legacy interval — logged once. + let pollJobId: ReturnType | undefined + let fallbackTimer: ReturnType | undefined + let warnedFallback = false + + if (state.config.ci.pollIntervalMs > 0) { + const intervalMs = state.config.ci.pollIntervalMs + try { + pollJobId = ctx.jobs.start({ + kind: 'github-ci', + label: 'dsh-github CI bot polling', + run: () => { + const timer = setInterval(tick, intervalMs) + timer.unref?.() + let settle!: (outcome: JobOutcome) => void + const done = new Promise((resolve) => { settle = resolve }) + return { + cancel: (reason?: string) => { + clearInterval(timer) + settle({ status: 'killed', detail: reason ?? 'polling disabled' }) + }, + done, + } + }, + }) + } catch (error) { + fallbackTimer = setInterval(tick, intervalMs) + fallbackTimer.unref?.() + if (!warnedFallback) { + warnedFallback = true + ctx.logger.warn(`dsh-github ci bot: no job controller serves the polling job (${error instanceof Error ? error.message : String(error)}); polling falls back to an interval. Load @deepseek-ai/dsh-tool-jobs to make the loop a visible job.`) + } + } + } const register = (name: string, description: string, hint: string, handler: (invocation: CommandInvocation) => CommandResult | Promise): () => void => commands.register({ name, description, input: { hint }, handler }) @@ -204,7 +242,8 @@ export function registerCiBot(ctx: Context, commands: CommandsService, state: Gi ] return () => { - if (timer !== undefined) clearInterval(timer) + if (pollJobId !== undefined) ctx.jobs.kill(pollJobId, undefined, 'dsh-github dispose') + if (fallbackTimer !== undefined) clearInterval(fallbackTimer) for (const dispose of disposers) dispose() } } diff --git a/src/client.ts b/src/client.ts index 2261e76..98dec54 100644 --- a/src/client.ts +++ b/src/client.ts @@ -8,21 +8,20 @@ * `GITHUB_TOKEN`), which is exactly where the host half resolves it — per * operation, no restart needed. * - * The card is collapsible and mirrors the host's `PluginCard` chrome one for - * one (same design tokens, same layout), the way the market card does: the - * plugins tab only lays out a flex column and dispatches - * `settings.plugin.item`, so the container is ours to draw, but drawing it - * with the same tokens is what keeps it from looking like it wandered in from - * another product. Buttons and the chevron come from the shared primitives. + * The card registers into the Plugins page's `plugins.item` list slot and + * renders the two views the page asks for: `summary` is the one-liner under + * the card's title, `page` is the form with its own save control. The page + * draws the title, icon, and crumb itself; buttons come from the shared + * primitives. * * The shipped `lib/client.js` is the __ModuleLoader__ bundle built from this * module (plain ESM here; the bundle wraps it in the loader factory). The * browser module loader executes that bundle, not this file. * @module @perrylink/dsh-github/client */ -import { createElement, useState, type ReactNode } from 'react' +import { createElement, useState, type ChangeEvent, type ReactNode } from 'react' import { - Button, IconChevronDownOutline14, IconLoadingOutline16, + Button, IconLoadingOutline16, } from '@deepseek-ai/dsh-client-ui-primitives' /** @@ -338,118 +337,100 @@ export interface GithubCardProps { t: (key: keyof GithubCardLocale) => string useGithubCard: (selector: (snapshot: GithubCardState) => GithubCardState) => GithubCardState submit: (value: string) => Promise + /** The view the Plugins page asks for: the one-liner under the title, or the form. */ + view: 'summary' | 'page' } -/** One class name builder (static strings only — no bundler CSS modules here). */ -const cx = (...parts: Array): string => parts.filter(Boolean).join(' ') - /** - * Render the GitHub card: a collapsible header naming the plugin, and — once - * expanded — the token control and the save/discard row. Renders nothing - * while the namespace is unavailable. + * Render the GitHub card. `summary` renders the one-liner the Plugins page + * places under the card's title (the description plus the token state badge); + * `page` renders the token control and the save/discard row on the plugin's + * own page. Renders nothing while the namespace is unavailable. */ export function GithubCard(props: GithubCardProps): ReactNode { const { t } = props const state = props.useGithubCard((snapshot) => snapshot) - const [open, setOpen] = useState(false) const [draft, setDraft] = useState('') if (!state.available) return null - const title = t('githubTitle') + if (props.view === 'summary') { + return createElement( + 'span', + { className: 'ghc-summary' }, + createElement('span', null, t('githubDescription')), + createElement( + 'span', + { className: state.configured ? 'ghc-badge' : 'ghc-badgeMuted' }, + state.configured ? t('tokenSet') : t('tokenUnset'), + ), + ) + } const dirty = draft.trim() !== '' const saveLabel = state.saving ? t('saving') : t('save') return createElement( - 'li', - { className: cx('ghc-card', open && 'ghc-cardOpen') }, + 'div', + { className: 'ghc-card ghc-cardPage' }, + !state.writable + ? createElement('p', { className: 'ghc-readOnly', role: 'status' }, t('readOnly')) + : null, createElement( - 'button', - { - type: 'button', - className: 'ghc-header', - 'aria-expanded': open, - 'aria-label': `${open ? 'Collapse' : 'Expand'}: ${title}`, - onClick: () => setOpen(!open), - }, + 'div', + { className: 'ghc-field' }, createElement( - 'span', - { className: 'ghc-headText' }, - createElement('span', { className: 'ghc-name' }, title), - createElement('span', { className: 'ghc-description' }, t('githubDescription')), + 'div', + { className: 'ghc-head' }, + createElement('label', { className: 'ghc-label', htmlFor: 'plugin-config-github-token' }, t('tokenLabel')), + createElement( + 'span', + { className: 'ghc-badges' }, + createElement( + 'span', + { className: state.configured ? 'ghc-badge' : 'ghc-badgeMuted' }, + state.configured ? t('tokenSet') : t('tokenUnset'), + ), + ), + ), + createElement('input', { + id: 'plugin-config-github-token', + className: 'ghc-input', + type: 'password', + autoComplete: 'off', + value: draft, + disabled: !state.credentialWritable, + onChange: (event: ChangeEvent) => setDraft(event.target.value), + }), + createElement('p', { className: 'ghc-hint' }, t('tokenHint')), + ), + createElement( + 'div', + { className: 'ghc-actions' }, + state.failed ? createElement('p', { className: 'ghc-failed', role: 'status' }, t('saveFailed')) : null, + createElement( + Button, + { + variant: 'ghost', + size: 'sm', + disabled: !dirty || state.saving, + onClick: () => setDraft(''), + }, + t('discard'), ), - dirty ? createElement('span', { className: 'ghc-pending' }, t('unsaved')) : null, createElement( - 'span', - { className: cx('ghc-chevron', open && 'ghc-chevronOpen') }, - createElement(IconChevronDownOutline14, { size: 14 }), + Button, + { + variant: 'primary', + size: 'sm', + disabled: !state.writable || !dirty || state.saving, + icon: state.saving + ? createElement('span', { className: 'ghc-spin' }, createElement(IconLoadingOutline16, { size: 16 })) + : undefined, + onClick: async () => { + const landed = await props.submit(draft) + if (landed) setDraft('') + }, + }, + saveLabel, ), ), - open - ? createElement( - 'div', - { className: 'ghc-body' }, - !state.writable - ? createElement('p', { className: 'ghc-readOnly', role: 'status' }, t('readOnly')) - : null, - createElement( - 'div', - { className: 'ghc-field' }, - createElement( - 'div', - { className: 'ghc-head' }, - createElement('label', { className: 'ghc-label', htmlFor: 'plugin-config-github-token' }, t('tokenLabel')), - createElement( - 'span', - { className: 'ghc-badges' }, - createElement( - 'span', - { className: state.configured ? 'ghc-badge' : 'ghc-badgeMuted' }, - state.configured ? t('tokenSet') : t('tokenUnset'), - ), - ), - ), - createElement('input', { - id: 'plugin-config-github-token', - className: 'ghc-input', - type: 'password', - autoComplete: 'off', - value: draft, - disabled: !state.credentialWritable, - onChange: (event) => setDraft(event.target.value), - }), - createElement('p', { className: 'ghc-hint' }, t('tokenHint')), - ), - createElement( - 'div', - { className: 'ghc-actions' }, - state.failed ? createElement('p', { className: 'ghc-failed', role: 'status' }, t('saveFailed')) : null, - createElement( - Button, - { - variant: 'ghost', - size: 'sm', - disabled: !dirty || state.saving, - onClick: () => setDraft(''), - }, - t('discard'), - ), - createElement( - Button, - { - variant: 'primary', - size: 'sm', - disabled: !state.writable || !dirty || state.saving, - icon: state.saving - ? createElement('span', { className: 'ghc-spin' }, createElement(IconLoadingOutline16, { size: 16 })) - : undefined, - onClick: async () => { - const landed = await props.submit(draft) - if (landed) setDraft('') - }, - }, - saveLabel, - ), - ), - ) - : null, ) } @@ -476,7 +457,7 @@ export interface ClientContextLike { } } -/** Mount the GitHub configuration card into the plugins settings section. */ +/** Mount the GitHub configuration card into the Plugins page's Official group. */ export function apply(ctx: ClientContextLike): void { const t = ctx.locale.bind(NS) ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dsh-github: card dictionaries') @@ -488,15 +469,15 @@ export function apply(ctx: ClientContextLike): void { () => ctx.remote.$on('credentials/reference-updated', (ref) => github.refreshCredential(ref)), 'dsh-github: credential invalidations', ) - ctx.slots.inject('settings.plugin.item', function* () { - yield ctx.slots.register( - { - name: 'settings.plugin.item', - key: NS, - locale: NS, - inject: () => github.inject(), - }, - GithubCard, - ) - }) + ctx.slots.inject('plugins.item', () => ctx.slots.register( + { + name: 'plugins.item', + id: NS, + order: 100, + label: () => t('githubTitle'), + locale: NS, + inject: () => github.inject(), + }, + GithubCard, + )) } diff --git a/src/commands.ts b/src/commands.ts index cd15a2a..43901c3 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -13,7 +13,7 @@ import { createUserMessage } from '@deepseek-ai/dsh-llm/message' import { readGitState } from './git.ts' import { startReviewJob } from './jobs.ts' -import type { CommandDefinition, CommandInvocation, CommandResult, CommandsService, GithubAgent, JobRegistry } from './types.ts' +import type { CommandDefinition, CommandInvocation, CommandResult, CommandsService, GithubAgent, GithubJobId, JobRegistry } from './types.ts' import type { GithubState } from './state.ts' const USAGE_PR = 'Usage: /pr create [title]' @@ -95,7 +95,12 @@ export function registerReviewCommand(commands: CommandsService, jobs: JobRegist if (!state.records.has(jobId)) { return { kind: 'error', text: `no review job "${jobId}". List jobs with job_list or check the /review output.` } } - const outcome = jobs.kill(jobId, invocation.agent, 'user requested stop via /review stop') + const outcome = jobs.kill( + jobId as GithubJobId, + // The runtime object is the host's Agent; GithubAgent is this plugin's minimal view. + invocation.agent as unknown as Parameters[1], + 'user requested stop via /review stop', + ) return { kind: 'success', text: outcome === 'requested' ? `requested stop of job ${jobId}` : `job ${jobId} had already finished` } } if (input.startsWith('post ')) { diff --git a/src/index.ts b/src/index.ts index 18c9978..4582660 100644 --- a/src/index.ts +++ b/src/index.ts @@ -99,7 +99,10 @@ export interface PluginDeps { export function applyWithDeps(ctx: Context, config: PluginConfig, deps: PluginDeps = {}) { // Consumer — the tool handlers consume the credentials service, the // optional subagents seam, and the git/gh runners assembled into `state`. - const state = createState({ credentials: ctx.credentials, subagents: ctx.get('subagents') as SubagentsService | undefined }, config, deps.runGit ?? runGitCli, deps.runGh ?? runGhCli, deps.fetchImpl) + // The subagents seam is optional at runtime although the official type + // declares it non-optional; the cast through unknown keeps the plugin's + // minimal structural face (see types.ts). + const state = createState({ credentials: ctx.credentials, subagents: ctx.get('subagents') as unknown as SubagentsService | undefined }, config, deps.runGit ?? runGitCli, deps.runGh ?? runGhCli, deps.fetchImpl) // Service Provider — registers the GitHub tools on ctx.tools; the /pr // /review /issue /ci commands and the write-approval gate register through diff --git a/src/jobs.ts b/src/jobs.ts index 7d6bd33..fdc0ec3 100644 --- a/src/jobs.ts +++ b/src/jobs.ts @@ -82,7 +82,9 @@ export function startReviewJob(registry: JobRegistry, state: GithubState, input: const spec: JobStartSpec = { kind: REVIEW_JOB_KIND, label: input.label, - owner: input.owner, + // The runtime object is the host's Agent; GithubAgent is this plugin's + // documented minimal view of it (see types.ts). + owner: input.owner as unknown as NonNullable, outputLimitBytes: 64 * 1024, run: () => runReviewWork(state, record, jobInput), } diff --git a/src/types.ts b/src/types.ts index 1fa3b81..5494eaa 100644 --- a/src/types.ts +++ b/src/types.ts @@ -9,6 +9,17 @@ * @module dsh-github/types */ import type { UserMessage } from '@deepseek-ai/dsh-llm/message' +import type { JobId, JobStart } from '@deepseek-ai/dsh-jobs' +import type { SubagentRun, SubagentStartRequest } from '@deepseek-ai/dsh-subagent' + +declare module '@deepseek-ai/dsh-jobs' { + interface JobKindMap { + /** The plugin's background review-job producer kind (`github-review-N` ids). */ + 'github-review': 'github-review' + /** The plugin's CI polling job kind (`github-ci-N` ids). */ + 'github-ci': 'github-ci' + } +} /** Minimal live-agent view: only the members dsh-github touches. */ export interface GithubAgent { @@ -52,52 +63,19 @@ export interface CommandsService { register(definition: CommandDefinition): () => void } -/** Registry-issued background-job id; the host generates `-N` strings. */ -export type GithubJobId = string & { readonly __githubJobId: unique symbol } - -/** Terminal result a review-job producer supplies through its hooks. */ -export interface JobOutcome { - status: 'completed' | 'killed' | 'failed' - detail?: string - /** Final output for final-output-only jobs. */ - output?: string -} - -/** Producer hooks through which the job runtime controls the work. */ -export interface JobHooks { - cancel(reason?: string): void - done: Promise -} - -/** Producer declaration passed to the job registry's start. */ -export interface JobStartSpec { - /** Producer kind — also the id prefix; the host treats kinds as opaque. */ - kind: string - /** One-line model-facing label. */ - label: string - outputLimitBytes?: number - owner?: GithubAgent - run(): JobHooks -} +/** Registry-issued background-job id (the official branded `JobId`). */ +export type GithubJobId = JobId -/** Read-only projection of one job. */ -export interface JobSnapshot { - id: string - kind: string - label: string - status: 'running' | 'stopping' | 'completed' | 'killed' | 'failed' - detail?: string - startedAt: number - finishedAt?: number - reported: boolean -} +/** Producer declaration passed to the job registry's start (official `JobStart`). */ +export type JobStartSpec = JobStart -/** Background-job registry subset used by dsh-github. */ -export interface JobRegistry { - start(spec: JobStartSpec): GithubJobId - kill(id: string, caller?: GithubAgent, reason?: string): 'requested' | 'already-finished' - get(id: string, caller?: GithubAgent): JobSnapshot -} +/** Re-export the official job seam faces the plugin consumes. */ +export type { + JobHooks, + JobOutcome, + JobSnapshot, + JobRegistry, +} from '@deepseek-ai/dsh-jobs' /** Closed approval outcomes; `allowed-once` is the only grant. */ export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable' @@ -114,36 +92,23 @@ export interface ApprovalRequest { /** Approval dispatch service subset used by dsh-github. */ export interface ApprovalService { request(req: ApprovalRequest): Promise + /** Switch one live agent's policy; the CI driver pins `'never'` (auto-grant, no escalation). */ + setPolicy(agent: GithubAgent, policy: 'ask' | 'never'): void } -/** Terminal result of one one-shot subagent run (model review). */ -export interface SubagentResultView { - readonly output: Array<{ type: string; text?: string }> - readonly stopReason: string -} - -/** One-shot subagent run handle (model review). */ -export interface SubagentRunView { - readonly result: Promise - dispose(): Promise -} - -/** Host subagent seam subset used by dsh-github's model review. */ +/** Host subagent seam subset used by dsh-github's model review: the official + * run/request faces, with the plugin's minimal agent view as the parent. */ export interface SubagentsService { list(): string[] - start(name: string, request: { - label?: string - prompt: Array<{ type: 'text'; text: string }> - parent: GithubAgent - signal: AbortSignal - }): Promise + start( + name: string, + request: Omit & { parent: GithubAgent }, + ): Promise } declare module '@deepseek-ai/cordis' { interface Context { commands: CommandsService - jobs: JobRegistry approval: ApprovalService - subagents?: SubagentsService } } diff --git a/test/ci.test.ts b/test/ci.test.ts index 6b8349b..0c254cd 100644 --- a/test/ci.test.ts +++ b/test/ci.test.ts @@ -350,11 +350,14 @@ describe('ci approval gate', () => { process.env.DSH_GITHUB_CI_DRIVER = '1' const allowed = await loaded(ciRoutes(), { ci: { enabled: true, pollIntervalMs: 0, reportDir, autoApprove: ['ci.run'] } }) expect(await decide(allowed, 'ci_run', { task: 'review', pr: 'o/r#7' })).toMatchObject({ kind: 'allow' }) + // The CI driver pins the calling agent's approval policy to 'never'. + expect(allowed.approval.policies).toContainEqual(expect.objectContaining({ policy: 'never' })) // Other writes still ask even in driver mode unless listed. expect(await decide(allowed, 'pr_merge', { pr: 'o/r#7' })).toMatchObject({ kind: 'ask' }) - // Without the allowlist entry the driver asks too. + // Without the allowlist entry the driver asks too, and pins no policy. const gated = await loaded(ciRoutes(), { ci: { enabled: true, pollIntervalMs: 0, reportDir, autoApprove: [] } }) expect(await decide(gated, 'ci_run', { task: 'review', pr: 'o/r#7' })).toMatchObject({ kind: 'ask' }) + expect(gated.approval.policies).toHaveLength(0) }) }) diff --git a/test/helpers.ts b/test/helpers.ts index 6156218..136facd 100644 --- a/test/helpers.ts +++ b/test/helpers.ts @@ -145,11 +145,18 @@ export class MockJobs { export class MockApproval { requests: ApprovalRequest[] = [] nextOutcome: ApprovalOutcome = 'allowed-once' + /** setPolicy calls recorded by the alpha.2 approval policy seam. */ + policies: Array<{ agent: unknown; policy: 'ask' | 'never' }> = [] async request(req: ApprovalRequest): Promise { this.requests.push(req) return this.nextOutcome } + + /** Official policy pin seam; tests record the call, no runtime effect. */ + setPolicy(agent: unknown, policy: 'ask' | 'never'): void { + this.policies.push({ agent, policy }) + } } /** Credentials mock: resolves from a Map keyed by the reference. */ diff --git a/tsconfig.ci.json b/tsconfig.ci.json new file mode 100644 index 0000000..e5a19f3 --- /dev/null +++ b/tsconfig.ci.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "paths": {} + } +} diff --git a/tsconfig.json b/tsconfig.json index 3dc5684..0a9acbe 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ "moduleResolution": "bundler", "allowImportingTsExtensions": true, "rewriteRelativeImportExtensions": true, - "lib": ["ES2024"], + "lib": ["ES2024", "DOM", "DOM.Iterable"], "types": ["node"], "outDir": "lib", "rootDir": "src", @@ -23,5 +23,5 @@ "isolatedModules": true }, "include": ["src"], - "exclude": ["node_modules", "lib", "test", "src/client.ts"] + "exclude": ["node_modules", "lib", "test"] }