@saoutax/dsh-full-access 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +81 -2
- package/README.zh.md +82 -0
- package/cordis.patch.yml +13 -0
- package/icon.svg +5 -0
- package/lib/client.js +744 -0
- package/lib/index.js +74 -0
- package/locale/en-US.json +12 -0
- package/locale/en.json +6 -0
- package/locale/zh-CN.json +12 -0
- package/locale/zh.json +6 -0
- package/package.json +85 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Saoutax
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,82 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @saoutax/dsh-full-access
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
English | [简体中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
A DeepSeek Harness plugin with two jobs: every new session starts in **Full access**, and the composer's permission chip switches modes without the extra risk confirmation.
|
|
6
|
+
|
|
7
|
+
## What it changes
|
|
8
|
+
|
|
9
|
+
- **New-session default.** When an Agent is created for a new conversation, the plugin pins the configured preset (default `danger-full-access`) onto that session. Resumed sessions, compacted sessions, and seeded forks keep the permission they inherited.
|
|
10
|
+
- **Composer chip without confirmation.** The permission chip in the composer toolbar is replaced by this plugin's own control. Choosing Full access or Auto review switches immediately; the shipped risk dialog never opens.
|
|
11
|
+
|
|
12
|
+
## What it leaves alone
|
|
13
|
+
|
|
14
|
+
- The `/permission` slash panel and the General-settings "default permission" row stay exactly as shipped. Selecting Full access or Auto review there still asks for acknowledgement, and typing `/permission <preset>` still switches directly (the Host runs the argued form without a gate).
|
|
15
|
+
- The General-settings default does **not** drive this plugin. Change the plugin's own `defaultPreset` instead, or disable the plugin to get the shipped default back.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
The package is published on npm. Install it with the DSH CLI:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh plugin --profile web add @saoutax/dsh-full-access
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The Plugin Manager also installs a bundle from a directory or a packed `.tgz`, which is useful for offline installs and local development.
|
|
26
|
+
|
|
27
|
+
After installation the plugin runs immediately; the Web page reloads its client graph and the composer chip appears in place of the shipped one.
|
|
28
|
+
|
|
29
|
+
## Configuration
|
|
30
|
+
|
|
31
|
+
| Field | Default | Meaning |
|
|
32
|
+
| --------------- | -------------------- | ---------------------------------------------------- |
|
|
33
|
+
| `defaultPreset` | `danger-full-access` | Preset pinned into every newly created conversation. |
|
|
34
|
+
|
|
35
|
+
The row lives in the profile's `cordis.patch.yml`:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
- id: full-access
|
|
39
|
+
name: '@saoutax/dsh-full-access'
|
|
40
|
+
config:
|
|
41
|
+
defaultPreset: danger-full-access
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The preset has to be one the deployment publishes through `@deepseek-ai/dsh-permission-presets`. When it is not, the plugin logs a warning at activation and leaves new sessions on the composed default.
|
|
45
|
+
|
|
46
|
+
## Compatibility and maintenance
|
|
47
|
+
|
|
48
|
+
The plugin registers one extra entry in the existing `conversation.input.permission` slot at a lower priority than the shipped chip; a single slot renders the lowest priority, so the two never render together and disabling this plugin restores the shipped chip. The rest is plain use of public surfaces:
|
|
49
|
+
|
|
50
|
+
- the slot name and its props (`locked`, `useProjection`, injected `select`);
|
|
51
|
+
- the `permission-presets` catalog Remote and its catalog-changed notification;
|
|
52
|
+
- the Host `/permission <preset>` command;
|
|
53
|
+
- the `agent/created` event and the `permissionPresets` service (`names`, `current`, `set`).
|
|
54
|
+
|
|
55
|
+
Verified against DSH `0.2.2-rc.1`. A future Harness that changes one of those surfaces needs a matching change here; the client bundle fails loudly (slot entry error in the page console) rather than silently doing nothing.
|
|
56
|
+
|
|
57
|
+
## Development
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
pnpm install
|
|
61
|
+
pnpm run build # build both halves and refresh icon.svg
|
|
62
|
+
pnpm run check # oxfmt + type-aware oxlint + tsc + vitest + build
|
|
63
|
+
pnpm run fmt # format
|
|
64
|
+
pnpm run lint # syntax lint
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
- `src/host/` builds to `lib/index.js` (ESM). Harness packages stay external and resolve from the dsh installation.
|
|
68
|
+
- `src/client/` builds to `lib/client.js`, wrapped as a `window.__ModuleLoader__.load({ id, factory })` registration. React and ReactDOM come from the page's module table; the chip glyphs are inlined from the shipped design set.
|
|
69
|
+
|
|
70
|
+
## Releases
|
|
71
|
+
|
|
72
|
+
Every push to `main` runs CI. On `main`, [release-please](https://github.com/googleapis/release-please) keeps one release PR open with the next version and the CHANGELOG entry. Merging that PR creates the tag and the GitHub Release, attaches the packed `.tgz`, and publishes that exact tag to npm.
|
|
73
|
+
|
|
74
|
+
The npm job needs a repository secret `NPM_TOKEN`: an npm automation token with publish rights for the `@saoutax` scope. Once the package exists on npm, a trusted publisher (repository `Saoutax/dsh-full-access`, workflow `release.yml`, environment `npm-publish`) can replace the token; see the comment in the workflow.
|
|
75
|
+
|
|
76
|
+
## Icons
|
|
77
|
+
|
|
78
|
+
The chip and menu glyphs reproduce the icon set that ships with DeepSeek Harness (MIT), so the control looks like the one it replaces. The plugin's own `icon.svg` is generated at build time from [Lucide](https://lucide.dev) icon data (`unlock-keyhole`); Lucide is licensed under the [ISC License](https://lucide.dev/license) and is used only by the build, never bundled into the client half.
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
The plugin's own code is MIT. The bundled Lucide artwork is ISC (see above).
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# @saoutax/dsh-full-access
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 简体中文
|
|
4
|
+
|
|
5
|
+
一个 DeepSeek Harness 插件,做两件事:新会话默认使用**完全权限**;输入框的权限芯片切换模式时不再弹额外的风险确认。
|
|
6
|
+
|
|
7
|
+
## 改变的行为
|
|
8
|
+
|
|
9
|
+
- **新会话默认值。** Agent 为新对话创建时,插件把配置的预设(默认 `danger-full-access`)写入该会话。恢复的会话、压缩后的会话和带种子的分叉保留它们继承的权限。
|
|
10
|
+
- **输入框芯片不再确认。** 输入框工具栏上的权限芯片由本插件自己的控件接管。选择完全权限或自动审查会立即切换,官方的风险确认框不再出现。
|
|
11
|
+
|
|
12
|
+
## 不做接管的部分
|
|
13
|
+
|
|
14
|
+
- `/permission` 斜杠面板和通用设置里的「默认权限」行保持官方实现。在那里选择完全权限或自动审查仍会要求勾选确认;直接输入 `/permission <预设名>` 仍然直接生效(Host 对带参数的写法不做确认)。
|
|
15
|
+
- 通用设置里的默认值**不会**影响本插件。要改默认权限,请改本插件自己的 `defaultPreset`;停用插件即可恢复官方默认。
|
|
16
|
+
|
|
17
|
+
## 安装
|
|
18
|
+
|
|
19
|
+
包已发布到 npm,用 DSH CLI 安装:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh plugin --profile web add @saoutax/dsh-full-access
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Plugin Manager 也支持从目录或打包好的 `.tgz` 安装,适合离线安装与本地开发。
|
|
26
|
+
|
|
27
|
+
安装后插件立即生效,页面会重建客户端模块图,输入框芯片替换为我们的控件。
|
|
28
|
+
|
|
29
|
+
## 配置
|
|
30
|
+
|
|
31
|
+
| 字段 | 默认值 | 含义 |
|
|
32
|
+
| --------------- | -------------------- | ------------------------ |
|
|
33
|
+
| `defaultPreset` | `danger-full-access` | 写入每个新建对话的预设。 |
|
|
34
|
+
|
|
35
|
+
这一行位于 profile 的 `cordis.patch.yml`:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
- id: full-access
|
|
39
|
+
name: '@saoutax/dsh-full-access'
|
|
40
|
+
config:
|
|
41
|
+
defaultPreset: danger-full-access
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
预设必须是本部署通过 `@deepseek-ai/dsh-permission-presets` 发布过的名字。如果不在目录里,插件会在激活时记录一条警告,新会话继续使用组合配置的默认权限。
|
|
45
|
+
|
|
46
|
+
## 兼容性与维护
|
|
47
|
+
|
|
48
|
+
插件只在既有的 `conversation.input.permission` 槽里新增一个注册,priority 低于官方芯片;single 槽只渲染 priority 最低的注册,所以两者不会同时出现,停用本插件就恢复官方芯片。其余都是公开接口:
|
|
49
|
+
|
|
50
|
+
- 槽名与它的属性(`locked`、`useProjection`、注入的 `select`);
|
|
51
|
+
- `permission-presets` 的目录 Remote 与目录变更通知;
|
|
52
|
+
- Host 的 `/permission <预设名>` 命令;
|
|
53
|
+
- `agent/created` 事件与 `permissionPresets` 服务的 `names`、`current`、`set`。
|
|
54
|
+
|
|
55
|
+
已在 DSH `0.2.2-rc.1` 上验证。后续 Harness 若改动其中任一接口,本插件需要同步修改;客户端部分会以槽条目报错的形式在页面控制台暴露问题,不会静默失效。
|
|
56
|
+
|
|
57
|
+
## 开发
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
pnpm install
|
|
61
|
+
pnpm run build # 构建两端产物并刷新 icon.svg
|
|
62
|
+
pnpm run check # oxfmt + 类型感知 oxlint + tsc + vitest + build
|
|
63
|
+
pnpm run fmt # 格式化
|
|
64
|
+
pnpm run lint # 语法 lint
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
- `src/host/` 构建为 `lib/index.js`(ESM)。Harness 包保持 external,运行时从 dsh 安装目录解析。
|
|
68
|
+
- `src/client/` 构建为 `lib/client.js`,包成 `window.__ModuleLoader__.load({ id, factory })` 注册。React 与 ReactDOM 来自页面的模块表;芯片字形内置在插件里。
|
|
69
|
+
|
|
70
|
+
## 发布
|
|
71
|
+
|
|
72
|
+
每次推送到 `main` 都会运行 CI。在 `main` 上,[release-please](https://github.com/googleapis/release-please) 会保持一个发布 PR,包含下一个版本号与 CHANGELOG 条目。合并该 PR 后创建 tag 与 GitHub Release,附加打包好的 `.tgz`,并把同一个 tag 发布到 npm。
|
|
73
|
+
|
|
74
|
+
npm 作业需要仓库 secret `NPM_TOKEN`:一个有 `@saoutax` 作用域发布权限的 npm automation token。包在 npm 上存在之后,可以改用 trusted publisher(仓库 `Saoutax/dsh-full-access`、workflow `release.yml`、environment `npm-publish`)替代 token,工作流注释里写了具体位置。
|
|
75
|
+
|
|
76
|
+
## 图标
|
|
77
|
+
|
|
78
|
+
芯片与菜单字形复制自 DeepSeek Harness 自带的图标集(MIT),让控件看起来与被替换的官方控件一致。插件自己的 `icon.svg` 在构建时由 [Lucide](https://lucide.dev) 图标数据生成(`unlock-keyhole`);Lucide 使用 [ISC 许可证](https://lucide.dev/license),只在构建阶段使用,不会打进客户端产物。
|
|
79
|
+
|
|
80
|
+
## 许可证
|
|
81
|
+
|
|
82
|
+
插件自身代码为 MIT。随包使用的 Lucide 图形为 ISC(见上)。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Bundle patch layer: the row loads this package's main entry as the host half
|
|
2
|
+
# (a plain Cordis plugin); the `dsh.client` declaration in package.json makes
|
|
3
|
+
# the web app load ./lib/client.js as the browser half.
|
|
4
|
+
#
|
|
5
|
+
# The shipped permission plugin stays enabled: this bundle only adds a
|
|
6
|
+
# lower-priority registration to the composer's permission slot, so the
|
|
7
|
+
# `/permission` popup and the General-settings row keep their official
|
|
8
|
+
# behavior.
|
|
9
|
+
- insert:
|
|
10
|
+
- id: full-access
|
|
11
|
+
name: '@saoutax/dsh-full-access'
|
|
12
|
+
config:
|
|
13
|
+
defaultPreset: danger-full-access
|
package/icon.svg
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#808080" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
+
<circle cx="12" cy="16" r="1" />
|
|
3
|
+
<rect width="18" height="12" x="3" y="10" rx="2" />
|
|
4
|
+
<path d="M7 10V7a5 5 0 0 1 9.33-2.5" />
|
|
5
|
+
</svg>
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,744 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: "@saoutax/dsh-full-access",
|
|
3
|
+
factory: (require) => {
|
|
4
|
+
"use strict";
|
|
5
|
+
var __dshFullAccessBundle = (() => {
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
12
|
+
}) : x)(function(x) {
|
|
13
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
14
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
15
|
+
});
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/client/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
createClientPlugin: () => createClientPlugin
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// src/shared.ts
|
|
37
|
+
var FULL_ACCESS_PRESET = "danger-full-access";
|
|
38
|
+
var AUTO_REVIEW_PRESET = "auto";
|
|
39
|
+
var PERMISSION_COMMAND = "permission";
|
|
40
|
+
var permissionCommandLine = (preset) => `/${PERMISSION_COMMAND} ${preset}`;
|
|
41
|
+
|
|
42
|
+
// src/client/store.ts
|
|
43
|
+
var createStore = (initial) => {
|
|
44
|
+
let value = initial;
|
|
45
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
46
|
+
const publish = (next) => {
|
|
47
|
+
if (Object.is(next, value)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
value = next;
|
|
51
|
+
for (const listener of listeners) {
|
|
52
|
+
listener();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
getSnapshot: () => value,
|
|
57
|
+
subscribe: (listener) => {
|
|
58
|
+
listeners.add(listener);
|
|
59
|
+
return () => {
|
|
60
|
+
listeners.delete(listener);
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
set: publish,
|
|
64
|
+
update: (reducer) => {
|
|
65
|
+
publish(reducer(value));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// src/client/catalog.ts
|
|
71
|
+
var isObject = (value) => {
|
|
72
|
+
return typeof value === "object" && value !== null;
|
|
73
|
+
};
|
|
74
|
+
var isConnectionLike = (value) => {
|
|
75
|
+
if (!isObject(value)) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
const generation = value.generation;
|
|
79
|
+
return isObject(generation) && typeof generation.getSnapshot === "function" && typeof generation.subscribe === "function";
|
|
80
|
+
};
|
|
81
|
+
var STATIC_GENERATION_ID = "static";
|
|
82
|
+
var emptyCatalogError = () => new Error("permission catalog has no complete value");
|
|
83
|
+
var PermissionCatalogDirectory = class {
|
|
84
|
+
/** Complete catalog; permission surfaces subscribe it for their option lists. */
|
|
85
|
+
store = createStore({ value: null });
|
|
86
|
+
/** One tick per invalidation, published before the replacement read starts. */
|
|
87
|
+
invalidations = createStore({
|
|
88
|
+
count: 0
|
|
89
|
+
});
|
|
90
|
+
ctx;
|
|
91
|
+
connection;
|
|
92
|
+
stopCatalog;
|
|
93
|
+
stopGeneration;
|
|
94
|
+
generationId;
|
|
95
|
+
initialized = false;
|
|
96
|
+
epoch = 0;
|
|
97
|
+
pending;
|
|
98
|
+
failure = emptyCatalogError();
|
|
99
|
+
disposed = false;
|
|
100
|
+
/**
|
|
101
|
+
* Subscribe to both invalidation sources before the first read, closing the
|
|
102
|
+
* install/read race.
|
|
103
|
+
* @param ctx - root Client context carrying Remote and the optional connection service.
|
|
104
|
+
*/
|
|
105
|
+
constructor(ctx) {
|
|
106
|
+
this.ctx = ctx;
|
|
107
|
+
const connection = ctx.get("connection");
|
|
108
|
+
this.connection = isConnectionLike(connection) ? connection : void 0;
|
|
109
|
+
this.stopCatalog = ctx.remote.$on("permission-presets/catalog-changed", () => {
|
|
110
|
+
this.invalidate();
|
|
111
|
+
this.refresh();
|
|
112
|
+
});
|
|
113
|
+
this.stopGeneration = this.connection?.generation.subscribe(() => {
|
|
114
|
+
this.syncGeneration();
|
|
115
|
+
});
|
|
116
|
+
this.syncGeneration();
|
|
117
|
+
}
|
|
118
|
+
/** Publish one invalidation so displayed options are dropped before the replacement read settles. */
|
|
119
|
+
invalidate() {
|
|
120
|
+
this.invalidations.set({ count: this.invalidations.getSnapshot().count + 1 });
|
|
121
|
+
}
|
|
122
|
+
/** Re-read for the current generation; a changed generation goes through `syncGeneration`. */
|
|
123
|
+
refresh() {
|
|
124
|
+
if (this.disposed) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const generationId = this.currentGenerationId();
|
|
128
|
+
if (generationId === void 0) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (generationId !== this.generationId) {
|
|
132
|
+
this.syncGeneration();
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
this.startRead(generationId);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Wait for a complete catalog of the current generation.
|
|
139
|
+
*
|
|
140
|
+
* An active read settles first instead of being reused, so a previous
|
|
141
|
+
* generation's answer can never be mistaken for the current one.
|
|
142
|
+
* @returns the current Host generation's complete permission catalog.
|
|
143
|
+
*/
|
|
144
|
+
async load() {
|
|
145
|
+
if (this.pending === void 0 && this.store.getSnapshot().value === null) {
|
|
146
|
+
this.refresh();
|
|
147
|
+
}
|
|
148
|
+
while (!this.disposed) {
|
|
149
|
+
const generationId = this.currentGenerationId();
|
|
150
|
+
if (generationId === void 0) {
|
|
151
|
+
throw new Error("permission catalog has no active Host connection");
|
|
152
|
+
}
|
|
153
|
+
if (generationId !== this.generationId) {
|
|
154
|
+
this.syncGeneration();
|
|
155
|
+
}
|
|
156
|
+
const pending = this.pending;
|
|
157
|
+
if (pending !== void 0) {
|
|
158
|
+
await pending;
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
const state = this.store.getSnapshot();
|
|
162
|
+
if (state.value !== null) {
|
|
163
|
+
return state.value;
|
|
164
|
+
}
|
|
165
|
+
throw this.failure;
|
|
166
|
+
}
|
|
167
|
+
throw new Error("permission catalog directory is disposed");
|
|
168
|
+
}
|
|
169
|
+
/** Stop both subscriptions and revoke every late settlement's write access. */
|
|
170
|
+
dispose() {
|
|
171
|
+
if (this.disposed) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
this.disposed = true;
|
|
175
|
+
this.epoch += 1;
|
|
176
|
+
this.pending = void 0;
|
|
177
|
+
this.stopGeneration?.();
|
|
178
|
+
this.stopCatalog();
|
|
179
|
+
}
|
|
180
|
+
/** Clear the old value on a generation switch, then read for the new one. */
|
|
181
|
+
syncGeneration() {
|
|
182
|
+
if (this.disposed) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const generationId = this.currentGenerationId();
|
|
186
|
+
if (this.initialized && generationId === this.generationId) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (this.initialized) {
|
|
190
|
+
this.invalidate();
|
|
191
|
+
}
|
|
192
|
+
this.initialized = true;
|
|
193
|
+
this.generationId = generationId;
|
|
194
|
+
this.epoch += 1;
|
|
195
|
+
this.pending = void 0;
|
|
196
|
+
this.failure = emptyCatalogError();
|
|
197
|
+
this.store.set({ value: null });
|
|
198
|
+
if (generationId !== void 0) {
|
|
199
|
+
this.startRead(generationId);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/** Start one independent read; the newest epoch in the same generation wins. */
|
|
203
|
+
startRead(generationId) {
|
|
204
|
+
const epoch = this.epoch += 1;
|
|
205
|
+
this.failure = emptyCatalogError();
|
|
206
|
+
const operation = this.ctx.remote.permissionPresets.catalog().then((result) => {
|
|
207
|
+
if (!result.ok) {
|
|
208
|
+
throw new Error(`${result.error?.code}: ${result.error?.message}`);
|
|
209
|
+
}
|
|
210
|
+
if (result.value === void 0) {
|
|
211
|
+
throw new Error("permission catalog answer has no value");
|
|
212
|
+
}
|
|
213
|
+
if (!this.accepts(epoch, generationId)) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
this.store.set({ value: result.value });
|
|
217
|
+
}).catch((error) => {
|
|
218
|
+
if (!this.accepts(epoch, generationId)) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
this.failure = error instanceof Error ? error : new Error(String(error));
|
|
222
|
+
this.store.set({ value: null });
|
|
223
|
+
}).finally(() => {
|
|
224
|
+
if (this.pending === operation) {
|
|
225
|
+
this.pending = void 0;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
this.pending = operation;
|
|
229
|
+
}
|
|
230
|
+
/** Fence a settlement by disposal, read epoch, recorded generation, and the live connection. */
|
|
231
|
+
accepts(epoch, generationId) {
|
|
232
|
+
return !this.disposed && epoch === this.epoch && generationId === this.generationId && this.currentGenerationId() === generationId;
|
|
233
|
+
}
|
|
234
|
+
/** Use a fixed generation without a connection service, else read the live one. */
|
|
235
|
+
currentGenerationId() {
|
|
236
|
+
if (this.connection === void 0) {
|
|
237
|
+
return STATIC_GENERATION_ID;
|
|
238
|
+
}
|
|
239
|
+
return this.connection.generation.getSnapshot()?.id;
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
// locale/en-US.json
|
|
244
|
+
var en_US_default = {
|
|
245
|
+
"chip.aria": "Switch permission mode: {name}",
|
|
246
|
+
"chip.hint": "Click to choose the permission mode for this session",
|
|
247
|
+
"preset.readOnly": "Read Only",
|
|
248
|
+
"preset.workspaceWrite": "Workspace Write",
|
|
249
|
+
"preset.fullAccess": "Full access",
|
|
250
|
+
"auto.label": "Auto review",
|
|
251
|
+
"auto.badge": "EXP",
|
|
252
|
+
"auto.description": "Run without a sandbox after an experimental same-model review of every native tool call and PTC inner call.",
|
|
253
|
+
"menu.label": "Permission mode",
|
|
254
|
+
"menu.active": "Current mode"
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
// locale/zh-CN.json
|
|
258
|
+
var zh_CN_default = {
|
|
259
|
+
"chip.aria": "\u5207\u6362\u6743\u9650\u6A21\u5F0F\uFF1A{name}",
|
|
260
|
+
"chip.hint": "\u70B9\u51FB\u9009\u62E9\u6B64\u4F1A\u8BDD\u7684\u6743\u9650\u6A21\u5F0F",
|
|
261
|
+
"preset.readOnly": "\u4EC5\u53EF\u67E5\u770B",
|
|
262
|
+
"preset.workspaceWrite": "\u5DE5\u4F5C\u533A\u5185\u4FEE\u6539",
|
|
263
|
+
"preset.fullAccess": "\u5B8C\u5168\u6743\u9650",
|
|
264
|
+
"auto.label": "\u81EA\u52A8\u5BA1\u67E5",
|
|
265
|
+
"auto.badge": "EXP",
|
|
266
|
+
"auto.description": "\u65E0\u6C99\u7BB1\u8FD0\u884C\uFF1B\u6BCF\u6B21\u539F\u751F\u5DE5\u5177\u8C03\u7528\u548C PTC \u5185\u5C42\u8C03\u7528\u524D\uFF0C\u7531\u4E0E\u5F53\u524D agent \u76F8\u540C\u7684\u6A21\u578B\u8FDB\u884C\u5B9E\u9A8C\u6027\u5BA1\u67E5\u3002",
|
|
267
|
+
"menu.label": "\u6743\u9650\u6A21\u5F0F",
|
|
268
|
+
"menu.active": "\u5F53\u524D\u6A21\u5F0F"
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
// src/client/locale.ts
|
|
272
|
+
var LOCALE_NS = "fullAccess";
|
|
273
|
+
var DICTS = {
|
|
274
|
+
en: en_US_default,
|
|
275
|
+
zh: zh_CN_default
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
// src/client/select.tsx
|
|
279
|
+
var import_react = __require("react");
|
|
280
|
+
var import_react_dom = __require("react-dom");
|
|
281
|
+
|
|
282
|
+
// src/icons.ts
|
|
283
|
+
var SHIELD = "M6.59624 2.14853C7.50155 1.80917 8.49914 1.80919 9.40444 2.14859L13.9245 3.84317V7.11961C13.9245 11.6089 10.5565 13.5975 8.00035 14.5779C5.44423 13.5975 2.07544 11.6089 2.07544 7.11961V3.84317L6.59624 2.14853Z";
|
|
284
|
+
var PRESET_GLYPHS = {
|
|
285
|
+
"read-only": {
|
|
286
|
+
paths: [
|
|
287
|
+
{
|
|
288
|
+
d: "M5.08545 8.13775L7.18455 10.2368C7.26636 10.3187 7.4003 10.3142 7.47649 10.2271L11.5148 5.61194",
|
|
289
|
+
stroke: "currentColor"
|
|
290
|
+
},
|
|
291
|
+
{ d: SHIELD, stroke: "currentColor", strokeLinejoin: "round" }
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
"workspace-write": {
|
|
295
|
+
paths: [
|
|
296
|
+
{
|
|
297
|
+
d: "M6.4209 1.68067C7.43922 1.299 8.56177 1.29898 9.58008 1.68067L14.0996 3.375C14.2946 3.44811 14.4236 3.63455 14.4238 3.84278V6.89063C14.1115 6.71853 13.7761 6.58312 13.4238 6.48926V4.18946L9.22852 2.61621C8.43657 2.31947 7.56341 2.31939 6.77148 2.61621L2.5752 4.18946V7.11914C2.5752 11.1796 5.52369 13.056 8 14.0391C8.27653 13.9293 8.55827 13.8067 8.8418 13.6729C9.07101 13.9468 9.33228 14.1929 9.62012 14.4053C9.12409 14.6579 8.63578 14.8696 8.17871 15.0449C8.0637 15.0889 7.93628 15.0889 7.82129 15.0449C5.22011 14.0472 1.5752 11.9381 1.5752 7.11914V3.84278C1.57541 3.63469 1.70463 3.44821 1.89941 3.375L6.4209 1.68067Z",
|
|
298
|
+
fill: "currentColor"
|
|
299
|
+
},
|
|
300
|
+
{ d: "M5.26392 6.60339H10.7361", stroke: "currentColor" },
|
|
301
|
+
{ d: "M5.26392 9.86902H8.32833", stroke: "currentColor" },
|
|
302
|
+
{
|
|
303
|
+
d: "M10.0317 13.2229C10.263 13.3929 10.4943 13.563 10.7256 13.733C10.7932 13.6482 10.8608 13.5634 10.9284 13.4786C12.1455 11.9522 13.3626 10.4258 14.5798 8.89935C14.6474 8.81455 14.715 8.72975 14.7826 8.64495C14.4143 8.37419 14.046 8.10344 13.6777 7.83268C13.6169 7.92252 13.5562 8.01236 13.4954 8.10219C12.4016 9.71926 11.3078 11.3363 10.214 12.9534C10.1532 13.0432 10.0924 13.1331 10.0317 13.2229Z",
|
|
304
|
+
fill: "currentColor"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
d: "M12.6516 12.6696C12.6516 12.925 12.6516 13.1804 12.6516 13.4359C12.6952 13.4378 12.7387 13.4398 12.7823 13.4417C13.5663 13.4768 14.3504 13.5118 15.1345 13.5469C15.178 13.5488 15.2216 13.5508 15.2651 13.5527C15.2651 13.2194 15.2651 12.8861 15.2651 12.5527C15.2216 12.5547 15.178 12.5566 15.1345 12.5586C14.3504 12.5936 13.5663 12.6287 12.7823 12.6637C12.7387 12.6657 12.6952 12.6676 12.6516 12.6696Z",
|
|
308
|
+
fill: "currentColor"
|
|
309
|
+
}
|
|
310
|
+
]
|
|
311
|
+
},
|
|
312
|
+
"danger-full-access": {
|
|
313
|
+
paths: [
|
|
314
|
+
{ d: SHIELD, stroke: "currentColor", strokeLinejoin: "round" },
|
|
315
|
+
{ d: "M8 4.39209V9.89209", stroke: "currentColor" },
|
|
316
|
+
{ d: "M8 10.8081V11.8081", stroke: "currentColor" }
|
|
317
|
+
]
|
|
318
|
+
},
|
|
319
|
+
auto: {
|
|
320
|
+
paths: [
|
|
321
|
+
{ d: SHIELD, stroke: "currentColor", strokeLinejoin: "round" },
|
|
322
|
+
{
|
|
323
|
+
d: "M5.75 10.15L8 4.95L10.25 10.15M6.43 8.59H9.57",
|
|
324
|
+
stroke: "currentColor",
|
|
325
|
+
strokeLinecap: "round",
|
|
326
|
+
strokeLinejoin: "round"
|
|
327
|
+
}
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
var MENU_GLYPHS = {
|
|
332
|
+
chevron: {
|
|
333
|
+
paths: [
|
|
334
|
+
{
|
|
335
|
+
d: "M4 6L7.29289 9.29289C7.68342 9.68342 8.31658 9.68342 8.70711 9.29289L12 6",
|
|
336
|
+
stroke: "currentColor"
|
|
337
|
+
}
|
|
338
|
+
]
|
|
339
|
+
},
|
|
340
|
+
check: {
|
|
341
|
+
paths: [
|
|
342
|
+
{
|
|
343
|
+
d: "M2.25 8.5L5.49732 11.7473C5.90519 12.1552 6.57263 12.1344 6.95426 11.7018L13.75 4",
|
|
344
|
+
stroke: "currentColor"
|
|
345
|
+
}
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
var presetGlyph = (preset) => PRESET_GLYPHS[preset];
|
|
350
|
+
var menuGlyph = (name) => MENU_GLYPHS[name];
|
|
351
|
+
|
|
352
|
+
// src/client/presentation.ts
|
|
353
|
+
var PRESET_LABEL_KEYS = /* @__PURE__ */ new Map([
|
|
354
|
+
["read-only", "preset.readOnly"],
|
|
355
|
+
["workspace-write", "preset.workspaceWrite"],
|
|
356
|
+
[FULL_ACCESS_PRESET, "preset.fullAccess"]
|
|
357
|
+
]);
|
|
358
|
+
var FALLBACK_LABELS = {
|
|
359
|
+
"preset.readOnly": "Read Only",
|
|
360
|
+
"preset.workspaceWrite": "Workspace Write",
|
|
361
|
+
"preset.fullAccess": "Full access"
|
|
362
|
+
};
|
|
363
|
+
var displayPresetName = (name) => {
|
|
364
|
+
if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(name)) {
|
|
365
|
+
return name;
|
|
366
|
+
}
|
|
367
|
+
return name.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
368
|
+
};
|
|
369
|
+
var permissionLabel = (option, t) => {
|
|
370
|
+
if (option.value === AUTO_REVIEW_PRESET) {
|
|
371
|
+
return t("auto.label");
|
|
372
|
+
}
|
|
373
|
+
const key = PRESET_LABEL_KEYS.get(option.value);
|
|
374
|
+
if (key !== void 0 && (option.name === option.value || option.name === FALLBACK_LABELS[key])) {
|
|
375
|
+
return t(key);
|
|
376
|
+
}
|
|
377
|
+
return displayPresetName(option.name);
|
|
378
|
+
};
|
|
379
|
+
var permissionDetail = (option, t) => {
|
|
380
|
+
return option.value === AUTO_REVIEW_PRESET ? t("auto.description") : option.description;
|
|
381
|
+
};
|
|
382
|
+
var permissionBadge = (option, t) => {
|
|
383
|
+
return option.value === AUTO_REVIEW_PRESET ? t("auto.badge") : void 0;
|
|
384
|
+
};
|
|
385
|
+
var menuItems = (catalog, currentValue, t) => {
|
|
386
|
+
return catalog.options.map((option) => {
|
|
387
|
+
const row = {
|
|
388
|
+
id: option.value,
|
|
389
|
+
label: permissionLabel(option, t),
|
|
390
|
+
active: option.value === currentValue
|
|
391
|
+
};
|
|
392
|
+
const detail = permissionDetail(option, t);
|
|
393
|
+
const badge = permissionBadge(option, t);
|
|
394
|
+
return {
|
|
395
|
+
...row,
|
|
396
|
+
...detail === void 0 ? {} : { detail },
|
|
397
|
+
...badge === void 0 ? {} : { badge }
|
|
398
|
+
};
|
|
399
|
+
});
|
|
400
|
+
};
|
|
401
|
+
var chipLabel = (catalog, currentValue, t) => {
|
|
402
|
+
const option = catalog.options.find((candidate) => candidate.value === currentValue);
|
|
403
|
+
if (option === void 0) {
|
|
404
|
+
return { label: displayPresetName(currentValue) };
|
|
405
|
+
}
|
|
406
|
+
const description = permissionDetail(option, t);
|
|
407
|
+
return {
|
|
408
|
+
label: permissionLabel(option, t),
|
|
409
|
+
...description === void 0 ? {} : { description }
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
// src/client/select.tsx
|
|
414
|
+
var import_jsx_runtime = __require("react/jsx-runtime");
|
|
415
|
+
var POPUP_GAP = 8;
|
|
416
|
+
var POPUP_MIN_WIDTH = 144;
|
|
417
|
+
var POPUP_MAX_HEIGHT = 360;
|
|
418
|
+
var Glyph = ({ glyph }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
419
|
+
"svg",
|
|
420
|
+
{
|
|
421
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
422
|
+
viewBox: "0 0 16 16",
|
|
423
|
+
width: 14,
|
|
424
|
+
height: 14,
|
|
425
|
+
fill: "none",
|
|
426
|
+
strokeWidth: 1,
|
|
427
|
+
"aria-hidden": "true",
|
|
428
|
+
focusable: "false",
|
|
429
|
+
children: glyph.paths.map((path, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { ...path }, `p${String(index)}`))
|
|
430
|
+
}
|
|
431
|
+
);
|
|
432
|
+
var Chevron = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Glyph, { glyph: menuGlyph("chevron") });
|
|
433
|
+
var Check = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Glyph, { glyph: menuGlyph("check") });
|
|
434
|
+
var PresetIcon = ({ preset }) => {
|
|
435
|
+
const glyph = presetGlyph(preset);
|
|
436
|
+
if (glyph === void 0) {
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Glyph, { glyph });
|
|
440
|
+
};
|
|
441
|
+
var measurePopup = (anchor) => {
|
|
442
|
+
const rect = anchor.getBoundingClientRect();
|
|
443
|
+
return {
|
|
444
|
+
left: Math.max(
|
|
445
|
+
POPUP_GAP,
|
|
446
|
+
Math.min(rect.left, window.innerWidth - POPUP_GAP - POPUP_MIN_WIDTH)
|
|
447
|
+
),
|
|
448
|
+
bottom: Math.max(POPUP_GAP, window.innerHeight - rect.top + 4),
|
|
449
|
+
minWidth: Math.max(rect.width, POPUP_MIN_WIDTH),
|
|
450
|
+
maxHeight: Math.min(POPUP_MAX_HEIGHT, Math.max(120, rect.top - POPUP_GAP * 2))
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
var PermissionSelect = ({
|
|
454
|
+
locked,
|
|
455
|
+
select,
|
|
456
|
+
usePermissionCatalog,
|
|
457
|
+
usePermissionInvalidations,
|
|
458
|
+
useProjection,
|
|
459
|
+
t
|
|
460
|
+
}) => {
|
|
461
|
+
const selection = useProjection("permissions");
|
|
462
|
+
const catalog = usePermissionCatalog((state) => state.value);
|
|
463
|
+
const invalidations = usePermissionInvalidations((state) => state.count);
|
|
464
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
465
|
+
const [pick, setPick] = (0, import_react.useState)(null);
|
|
466
|
+
const [highlight, setHighlight] = (0, import_react.useState)(0);
|
|
467
|
+
const [box, setBox] = (0, import_react.useState)(null);
|
|
468
|
+
const anchorRef = (0, import_react.useRef)(null);
|
|
469
|
+
const popupRef = (0, import_react.useRef)(null);
|
|
470
|
+
const currentValue = pick !== null && (catalog?.options.some((option) => option.value === pick) ?? false) ? pick : selection?.currentValue ?? "";
|
|
471
|
+
const close = (0, import_react.useCallback)((returnFocus) => {
|
|
472
|
+
setOpen(false);
|
|
473
|
+
setBox(null);
|
|
474
|
+
if (returnFocus) {
|
|
475
|
+
anchorRef.current?.focus();
|
|
476
|
+
}
|
|
477
|
+
}, []);
|
|
478
|
+
(0, import_react.useEffect)(() => {
|
|
479
|
+
setOpen(false);
|
|
480
|
+
setBox(null);
|
|
481
|
+
setPick(null);
|
|
482
|
+
}, [invalidations]);
|
|
483
|
+
(0, import_react.useEffect)(() => {
|
|
484
|
+
if (locked) {
|
|
485
|
+
setOpen(false);
|
|
486
|
+
setBox(null);
|
|
487
|
+
}
|
|
488
|
+
}, [locked]);
|
|
489
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
490
|
+
const anchor = anchorRef.current;
|
|
491
|
+
if (!open || anchor === null) {
|
|
492
|
+
return () => {
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
const update = () => {
|
|
496
|
+
setBox(measurePopup(anchor));
|
|
497
|
+
};
|
|
498
|
+
update();
|
|
499
|
+
window.addEventListener("resize", update);
|
|
500
|
+
window.addEventListener("scroll", update, true);
|
|
501
|
+
return () => {
|
|
502
|
+
window.removeEventListener("resize", update);
|
|
503
|
+
window.removeEventListener("scroll", update, true);
|
|
504
|
+
};
|
|
505
|
+
}, [open]);
|
|
506
|
+
(0, import_react.useEffect)(() => {
|
|
507
|
+
if (open) {
|
|
508
|
+
popupRef.current?.focus();
|
|
509
|
+
}
|
|
510
|
+
}, [open]);
|
|
511
|
+
(0, import_react.useEffect)(() => {
|
|
512
|
+
if (!open) {
|
|
513
|
+
return () => {
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
const onPointerDown = (event) => {
|
|
517
|
+
const target = event.target;
|
|
518
|
+
if (!(target instanceof Node)) {
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
if (anchorRef.current?.contains(target) === true) {
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
if (popupRef.current?.contains(target) === true) {
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
setOpen(false);
|
|
528
|
+
setBox(null);
|
|
529
|
+
};
|
|
530
|
+
document.addEventListener("pointerdown", onPointerDown, true);
|
|
531
|
+
return () => {
|
|
532
|
+
document.removeEventListener("pointerdown", onPointerDown, true);
|
|
533
|
+
};
|
|
534
|
+
}, [open]);
|
|
535
|
+
const submit = async (preset) => {
|
|
536
|
+
try {
|
|
537
|
+
await select(preset);
|
|
538
|
+
} catch (error) {
|
|
539
|
+
console.error("full-access: switching the permission preset failed", error);
|
|
540
|
+
} finally {
|
|
541
|
+
setPick(null);
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
if (selection === void 0 || catalog === null) {
|
|
545
|
+
return null;
|
|
546
|
+
}
|
|
547
|
+
const items = menuItems(catalog, currentValue, t);
|
|
548
|
+
const label = chipLabel(catalog, currentValue, t);
|
|
549
|
+
const busy = pick !== null;
|
|
550
|
+
const choose = (preset) => {
|
|
551
|
+
close(false);
|
|
552
|
+
if (preset === currentValue) {
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
setPick(preset);
|
|
556
|
+
void submit(preset);
|
|
557
|
+
};
|
|
558
|
+
const openPopup = () => {
|
|
559
|
+
const index = items.findIndex((item) => item.id === currentValue);
|
|
560
|
+
setHighlight(index < 0 ? 0 : index);
|
|
561
|
+
setOpen(true);
|
|
562
|
+
};
|
|
563
|
+
const onPopupKeyDown = (event) => {
|
|
564
|
+
if (event.key === "Escape") {
|
|
565
|
+
event.preventDefault();
|
|
566
|
+
close(true);
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
if (event.key === "Tab") {
|
|
570
|
+
close(false);
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
574
|
+
event.preventDefault();
|
|
575
|
+
setHighlight((current) => {
|
|
576
|
+
if (items.length === 0) {
|
|
577
|
+
return 0;
|
|
578
|
+
}
|
|
579
|
+
const step = event.key === "ArrowDown" ? 1 : -1;
|
|
580
|
+
return (current + step + items.length) % items.length;
|
|
581
|
+
});
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
585
|
+
const target = items[highlight];
|
|
586
|
+
if (target !== void 0) {
|
|
587
|
+
event.preventDefault();
|
|
588
|
+
choose(target.id);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
593
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
594
|
+
"button",
|
|
595
|
+
{
|
|
596
|
+
ref: anchorRef,
|
|
597
|
+
type: "button",
|
|
598
|
+
className: "dshFullAccess_trigger",
|
|
599
|
+
"aria-label": t("chip.aria", { name: label.label }),
|
|
600
|
+
"aria-haspopup": "menu",
|
|
601
|
+
"aria-expanded": open,
|
|
602
|
+
title: label.description ?? t("chip.hint"),
|
|
603
|
+
disabled: locked || busy,
|
|
604
|
+
onClick: () => {
|
|
605
|
+
if (open) {
|
|
606
|
+
close(false);
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
openPopup();
|
|
610
|
+
},
|
|
611
|
+
children: [
|
|
612
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dshFullAccess_triggerIcon", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PresetIcon, { preset: currentValue }) }),
|
|
613
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dshFullAccess_triggerLabel", children: label.label }),
|
|
614
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
615
|
+
"span",
|
|
616
|
+
{
|
|
617
|
+
className: `dshFullAccess_chevron${open ? " dshFullAccess_chevronOpen" : ""}`,
|
|
618
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Chevron, {})
|
|
619
|
+
}
|
|
620
|
+
)
|
|
621
|
+
]
|
|
622
|
+
}
|
|
623
|
+
),
|
|
624
|
+
open && box !== null && (0, import_react_dom.createPortal)(
|
|
625
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
626
|
+
"div",
|
|
627
|
+
{
|
|
628
|
+
ref: popupRef,
|
|
629
|
+
role: "menu",
|
|
630
|
+
"aria-label": t("menu.label"),
|
|
631
|
+
tabIndex: -1,
|
|
632
|
+
className: "dshFullAccess_popup",
|
|
633
|
+
style: {
|
|
634
|
+
left: box.left,
|
|
635
|
+
bottom: box.bottom,
|
|
636
|
+
minWidth: box.minWidth,
|
|
637
|
+
maxHeight: box.maxHeight
|
|
638
|
+
},
|
|
639
|
+
onKeyDown: onPopupKeyDown,
|
|
640
|
+
children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
641
|
+
"button",
|
|
642
|
+
{
|
|
643
|
+
type: "button",
|
|
644
|
+
role: "menuitemradio",
|
|
645
|
+
"aria-checked": item.active,
|
|
646
|
+
tabIndex: -1,
|
|
647
|
+
title: item.detail,
|
|
648
|
+
className: [
|
|
649
|
+
"dshFullAccess_option",
|
|
650
|
+
index === highlight ? "dshFullAccess_optionHighlight" : ""
|
|
651
|
+
].filter(Boolean).join(" "),
|
|
652
|
+
onPointerMove: () => {
|
|
653
|
+
setHighlight(index);
|
|
654
|
+
},
|
|
655
|
+
onClick: () => {
|
|
656
|
+
choose(item.id);
|
|
657
|
+
},
|
|
658
|
+
children: [
|
|
659
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dshFullAccess_optionIcon", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PresetIcon, { preset: item.id }) }),
|
|
660
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dshFullAccess_optionLabel", children: [
|
|
661
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dshFullAccess_optionLabelText", children: item.label }),
|
|
662
|
+
item.badge === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dshFullAccess_optionBadge", children: item.badge })
|
|
663
|
+
] }),
|
|
664
|
+
item.active ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dshFullAccess_optionCheck", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, {}) }) : null
|
|
665
|
+
]
|
|
666
|
+
},
|
|
667
|
+
item.id
|
|
668
|
+
))
|
|
669
|
+
}
|
|
670
|
+
),
|
|
671
|
+
document.body
|
|
672
|
+
)
|
|
673
|
+
] });
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
// src/client/styles.ts
|
|
677
|
+
var registerStyles = (ctx, css) => {
|
|
678
|
+
ctx.effect(() => {
|
|
679
|
+
const tag = document.createElement("style");
|
|
680
|
+
tag.dataset.plugin = "full-access";
|
|
681
|
+
tag.dataset.pluginCss = "full-access/chip.css";
|
|
682
|
+
tag.textContent = css;
|
|
683
|
+
document.head.append(tag);
|
|
684
|
+
return () => {
|
|
685
|
+
tag.remove();
|
|
686
|
+
};
|
|
687
|
+
}, "full-access: stylesheet");
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
// src/client/styles.css
|
|
691
|
+
var styles_default = "/*\n * Styles of the composer permission chip and its popup.\n *\n * Both surfaces reproduce the shipped declarations with the plugin's own class\n * prefix: the chip copies the permission plugin's stylesheet, the popup copies\n * the menu primitive's list and item rules. Every color and radius goes through\n * the host theme variables, each with a fallback so a missing token degrades to\n * a close value instead of breaking the control.\n */\n\n.dshFullAccess_trigger {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n min-width: 0;\n max-width: 220px;\n height: 28px;\n padding: 0 4px 0 8px;\n border: none;\n border-radius: var(--dsw-radius-sm, 8px);\n outline: none;\n background: transparent;\n color: var(--dsw-alias-label-secondary, #5f6368);\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .dshFullAccess_trigger:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, #2631480f);\n }\n}\n\n.dshFullAccess_trigger:focus-visible {\n box-shadow: 0 0 0 2px\n var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary, #4d6bfe));\n}\n\n.dshFullAccess_trigger:disabled {\n color: var(--dsw-alias-label-dimmed, #c7cbd4);\n cursor: default;\n}\n\n.dshFullAccess_triggerIcon {\n display: inline-flex;\n flex: none;\n}\n\n.dshFullAccess_triggerIcon svg {\n width: 14px;\n height: 14px;\n}\n\n.dshFullAccess_triggerLabel {\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.dshFullAccess_chevron {\n display: inline-flex;\n flex: none;\n color: var(--dsw-alias-label-caption, #9aa0aa);\n transition: transform 0.12s;\n}\n\n.dshFullAccess_chevronOpen {\n transform: rotate(180deg);\n}\n\n.dshFullAccess_popup {\n position: fixed;\n z-index: 1100;\n display: flex;\n flex-direction: column;\n gap: 0;\n box-sizing: border-box;\n min-width: min(144px, 100vw);\n max-width: min(360px, 100vw);\n padding: 4px;\n overflow-y: auto;\n overscroll-behavior: contain;\n border: 0;\n border-radius: var(--dsw-radius-lg, 16px);\n outline: none;\n background: var(--dsw-menu-surface-fill, var(--dsw-alias-bg-overlay, #fff));\n backdrop-filter: var(--dsw-menu-backdrop-filter, blur(40px) saturate(150%));\n box-shadow:\n var(--dsw-elevation-prominent, 0 3px 8px 0 #0000000a),\n 0 0 20px 0 #0000000d;\n animation: dshFullAccessMenuIn var(--dsh-menu-enter, 120ms) ease-out;\n}\n\n@keyframes dshFullAccessMenuIn {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dshFullAccess_popup {\n animation-duration: 0ms;\n }\n}\n\n.dshFullAccess_option {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n min-height: 34px;\n padding: 6px 8px;\n border: none;\n border-radius: var(--dsw-radius-md, 12px);\n background: transparent;\n color: var(--dsw-alias-label-primary, #1c1e23);\n font-size: 13px;\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .dshFullAccess_option:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, #2631480f);\n }\n}\n\n.dshFullAccess_optionHighlight,\n.dshFullAccess_option:focus-visible {\n background: var(--dsw-alias-interactive-bg-hover, #2631480f);\n outline: none;\n}\n\n.dshFullAccess_optionIcon {\n display: inline-flex;\n flex: none;\n width: 14px;\n height: 14px;\n align-items: center;\n justify-content: center;\n color: var(--dsw-alias-menu-icon, #3a3f48);\n}\n\n.dshFullAccess_optionIcon svg {\n width: 14px;\n height: 14px;\n}\n\n.dshFullAccess_optionLabel {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n flex: 1;\n min-width: 0;\n}\n\n.dshFullAccess_optionLabelText {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.dshFullAccess_optionBadge {\n flex: none;\n color: var(--dsw-alias-label-tertiary, #7b818c);\n font-size: 8px;\n font-weight: 500;\n line-height: 10px;\n letter-spacing: 0.2px;\n}\n\n.dshFullAccess_optionCheck {\n display: inline-flex;\n flex: none;\n color: var(--dsw-alias-label-primary, #1c1e23);\n}\n\n.dshFullAccess_optionCheck svg {\n width: 14px;\n height: 14px;\n}\n\n@container (width <= 460px) {\n .dshFullAccess_trigger:has(.dshFullAccess_triggerIcon) .dshFullAccess_triggerLabel {\n display: none;\n }\n}\n";
|
|
692
|
+
|
|
693
|
+
// src/client/index.ts
|
|
694
|
+
var CHIP_SLOT = "conversation.input.permission";
|
|
695
|
+
var CHIP_PRIORITY = -1;
|
|
696
|
+
var createClientPlugin = () => {
|
|
697
|
+
return {
|
|
698
|
+
name: "full-access-client",
|
|
699
|
+
inject: ["slots", "locale", "sessions", "remote", "remote.permissionPresets"],
|
|
700
|
+
apply: (ctx) => {
|
|
701
|
+
registerStyles(ctx, styles_default);
|
|
702
|
+
ctx.effect(() => ctx.locale.register(LOCALE_NS, DICTS), "full-access: dictionaries");
|
|
703
|
+
const catalog = new PermissionCatalogDirectory(ctx);
|
|
704
|
+
ctx.effect(
|
|
705
|
+
() => () => {
|
|
706
|
+
catalog.dispose();
|
|
707
|
+
},
|
|
708
|
+
"full-access: process catalog"
|
|
709
|
+
);
|
|
710
|
+
const submit = async (sessionId, preset) => {
|
|
711
|
+
const live = ctx.sessions.binding(sessionId)?.session;
|
|
712
|
+
if (live === void 0) {
|
|
713
|
+
return false;
|
|
714
|
+
}
|
|
715
|
+
const answer = await live.command(permissionCommandLine(preset));
|
|
716
|
+
return answer.ok && answer.value?.matched === true;
|
|
717
|
+
};
|
|
718
|
+
ctx.slots.inject(
|
|
719
|
+
CHIP_SLOT,
|
|
720
|
+
() => ctx.slots.register(
|
|
721
|
+
{
|
|
722
|
+
name: CHIP_SLOT,
|
|
723
|
+
priority: CHIP_PRIORITY,
|
|
724
|
+
locale: LOCALE_NS,
|
|
725
|
+
inject: (sessionId) => ({
|
|
726
|
+
hooks: {
|
|
727
|
+
permissionCatalog: catalog.store,
|
|
728
|
+
permissionInvalidations: catalog.invalidations
|
|
729
|
+
},
|
|
730
|
+
select: (preset) => submit(sessionId, preset)
|
|
731
|
+
})
|
|
732
|
+
},
|
|
733
|
+
PermissionSelect
|
|
734
|
+
)
|
|
735
|
+
);
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
return __toCommonJS(index_exports);
|
|
740
|
+
})();
|
|
741
|
+
|
|
742
|
+
return __dshFullAccessBundle.createClientPlugin()
|
|
743
|
+
},
|
|
744
|
+
})
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/host/config.ts
|
|
2
|
+
import z from "@deepseek-ai/schemastery";
|
|
3
|
+
|
|
4
|
+
// src/shared.ts
|
|
5
|
+
var FULL_ACCESS_PRESET = "danger-full-access";
|
|
6
|
+
var DEFAULT_PRESET = FULL_ACCESS_PRESET;
|
|
7
|
+
|
|
8
|
+
// src/host/config.ts
|
|
9
|
+
var Config = z.object({
|
|
10
|
+
/**
|
|
11
|
+
* Preset every freshly created Session starts with.
|
|
12
|
+
*
|
|
13
|
+
* Change `config.defaultPreset` on this plugin's row in `cordis.patch.yml`.
|
|
14
|
+
* The value has to be one of the presets the deployment publishes; when it
|
|
15
|
+
* is not, sessions keep the composed default and the Host logs a warning.
|
|
16
|
+
*/
|
|
17
|
+
defaultPreset: z.string().default(DEFAULT_PRESET).volatile()
|
|
18
|
+
});
|
|
19
|
+
var readConfig = (source) => ({
|
|
20
|
+
defaultPreset: source.defaultPreset.get()
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// src/host/policy.ts
|
|
24
|
+
var INITIAL_SOURCES = ["startup", "clear"];
|
|
25
|
+
var shouldPin = (input) => !input.seeded && INITIAL_SOURCES.includes(input.source) && input.available.includes(input.desired) && input.current !== input.desired;
|
|
26
|
+
|
|
27
|
+
// src/host/index.ts
|
|
28
|
+
var name = "full-access";
|
|
29
|
+
var inject = ["permissionPresets"];
|
|
30
|
+
var describe = (error) => error instanceof Error ? error.message : String(error);
|
|
31
|
+
var apply = (ctx, config) => {
|
|
32
|
+
const service = ctx.permissionPresets;
|
|
33
|
+
if (!service.names.includes(readConfig(config).defaultPreset)) {
|
|
34
|
+
ctx.logger.warn(
|
|
35
|
+
`full-access: preset "${readConfig(config).defaultPreset}" is not offered by this deployment; new sessions keep the composed default`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
ctx.effect(
|
|
39
|
+
() => ctx.on("agent/created", ({ agent, source }) => {
|
|
40
|
+
const desired = readConfig(config).defaultPreset;
|
|
41
|
+
let current;
|
|
42
|
+
try {
|
|
43
|
+
current = service.current(agent.session);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
ctx.logger.warn(
|
|
46
|
+
`full-access: could not read the session permission: ${describe(error)}`
|
|
47
|
+
);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const pin = shouldPin({
|
|
51
|
+
source,
|
|
52
|
+
seeded: agent.session.header.isSeeded,
|
|
53
|
+
desired,
|
|
54
|
+
available: service.names,
|
|
55
|
+
current
|
|
56
|
+
});
|
|
57
|
+
if (!pin) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
service.set(agent.session, desired);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
ctx.logger.warn(`full-access: could not pin "${desired}": ${describe(error)}`);
|
|
64
|
+
}
|
|
65
|
+
}),
|
|
66
|
+
"full-access: new-session default"
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
Config,
|
|
71
|
+
apply,
|
|
72
|
+
inject,
|
|
73
|
+
name
|
|
74
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"chip.aria": "Switch permission mode: {name}",
|
|
3
|
+
"chip.hint": "Click to choose the permission mode for this session",
|
|
4
|
+
"preset.readOnly": "Read Only",
|
|
5
|
+
"preset.workspaceWrite": "Workspace Write",
|
|
6
|
+
"preset.fullAccess": "Full access",
|
|
7
|
+
"auto.label": "Auto review",
|
|
8
|
+
"auto.badge": "EXP",
|
|
9
|
+
"auto.description": "Run without a sandbox after an experimental same-model review of every native tool call and PTC inner call.",
|
|
10
|
+
"menu.label": "Permission mode",
|
|
11
|
+
"menu.active": "Current mode"
|
|
12
|
+
}
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"chip.aria": "切换权限模式:{name}",
|
|
3
|
+
"chip.hint": "点击选择此会话的权限模式",
|
|
4
|
+
"preset.readOnly": "仅可查看",
|
|
5
|
+
"preset.workspaceWrite": "工作区内修改",
|
|
6
|
+
"preset.fullAccess": "完全权限",
|
|
7
|
+
"auto.label": "自动审查",
|
|
8
|
+
"auto.badge": "EXP",
|
|
9
|
+
"auto.description": "无沙箱运行;每次原生工具调用和 PTC 内层调用前,由与当前 agent 相同的模型进行实验性审查。",
|
|
10
|
+
"menu.label": "权限模式",
|
|
11
|
+
"menu.active": "当前模式"
|
|
12
|
+
}
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,86 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@saoutax/dsh-full-access",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Default every new session to Full access and drop the risk confirmation from the composer permission chip.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/Saoutax/dsh-full-access"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"lib/index.js",
|
|
12
|
+
"lib/client.js",
|
|
13
|
+
"cordis.patch.yml",
|
|
14
|
+
"locale/*.json",
|
|
15
|
+
"icon.svg"
|
|
16
|
+
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "lib/index.js",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": "./lib/index.js",
|
|
21
|
+
"./client": "./lib/client.js",
|
|
22
|
+
"./package.json": "./package.json",
|
|
23
|
+
"./locale/*.json": "./locale/*.json",
|
|
24
|
+
"./icon": "./icon.svg"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "node scripts/build.mjs",
|
|
31
|
+
"check": "pnpm run fmt:check && pnpm run lint:ci && pnpm run typecheck && pnpm run test && pnpm run build",
|
|
32
|
+
"fmt": "oxfmt",
|
|
33
|
+
"fmt:check": "oxfmt --check",
|
|
34
|
+
"lint": "oxlint",
|
|
35
|
+
"lint:ci": "oxlint --type-aware --type-check",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.client.json && tsc --noEmit -p tsconfig.test.json"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@deepseek-ai/cordis": "4.1.0",
|
|
41
|
+
"@deepseek-ai/schemastery": "3.19.0",
|
|
42
|
+
"@types/node": "^22.10.2",
|
|
43
|
+
"@types/react": "^18.3.12",
|
|
44
|
+
"@types/react-dom": "^18.3.7",
|
|
45
|
+
"esbuild": "0.28.2",
|
|
46
|
+
"lucide": "1.66.0",
|
|
47
|
+
"oxfmt": "0.75.0",
|
|
48
|
+
"oxlint": "1.90.0",
|
|
49
|
+
"oxlint-tsgolint": "7.0.2005",
|
|
50
|
+
"typescript": "5.7.2",
|
|
51
|
+
"vitest": "^4.1.11"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"@deepseek-ai/cordis": "^4.1.0",
|
|
55
|
+
"@deepseek-ai/schemastery": "^3.19.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependenciesMeta": {
|
|
58
|
+
"@deepseek-ai/cordis": {
|
|
59
|
+
"optional": true
|
|
60
|
+
},
|
|
61
|
+
"@deepseek-ai/schemastery": {
|
|
62
|
+
"optional": true
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"dsh": ">=0.2.2-rc.1",
|
|
67
|
+
"node": ">=22.19.0"
|
|
68
|
+
},
|
|
69
|
+
"packageManager": "pnpm@12.6.0",
|
|
70
|
+
"dsh": {
|
|
71
|
+
"bundle": {
|
|
72
|
+
"patch": "./cordis.patch.yml"
|
|
73
|
+
},
|
|
74
|
+
"client": {
|
|
75
|
+
"platform": "web",
|
|
76
|
+
"immediately": true,
|
|
77
|
+
"inject": [
|
|
78
|
+
"@deepseek-ai/dsh-api-remotes",
|
|
79
|
+
"@deepseek-ai/dsh-api-session-controller",
|
|
80
|
+
"@deepseek-ai/dsh-client-connection",
|
|
81
|
+
"@deepseek-ai/dsh-client-locale",
|
|
82
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|