dsh-use-codex 0.4.0 → 0.4.1

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.
Files changed (2) hide show
  1. package/lib/index.js +25 -0
  2. package/package.json +4 -1
package/lib/index.js CHANGED
@@ -220,6 +220,31 @@ function textTool({ name: toolName, description, parameters, timeoutMs, execute
220
220
  };
221
221
  }
222
222
 
223
+ /** Settings-page schema builder; returns null when schemastery is unavailable. */
224
+ let _Config = null;
225
+ try {
226
+ const { default: z } = await import('@deepseek-ai/schemastery');
227
+ _Config = z.object({
228
+ enabled: z.boolean().default(true)
229
+ .description('启动时是否注册 Codex 委派工具(改为 false 并重启可完全停用)。'),
230
+ bin: z.string().default('codex')
231
+ .description('Codex CLI 可执行文件路径;留空用 PATH 中的 codex。'),
232
+ defaultCwd: z.string().default('')
233
+ .description('默认工作目录;留空用 DSH 进程当前目录。'),
234
+ allowedRoots: z.array(z.string()).role('textarea').default([])
235
+ .description('允许 Codex 工作的目录白名单,每行一个绝对路径。'),
236
+ allowDangerFullAccess: z.boolean().default(false)
237
+ .description('完全权限总许可:开启后可用 codex_danger 开关让 codex_run 默认以 danger-full-access(无沙箱)运行。关闭则任何方式都无法使用危险模式。'),
238
+ timeoutSec: z.number().min(1).max(3600).step(1).default(900)
239
+ .description('单次任务超时上限(秒)。'),
240
+ maxOutputChars: z.number().min(1000).max(200000).step(500).default(20000)
241
+ .description('返回输出的最大字符数。'),
242
+ }).description('Codex 委派');
243
+ } catch {}
244
+
245
+ /** DSH settings UI renders this panel; null schema = no settings page. */
246
+ export const Config = _Config;
247
+
223
248
  export function apply(ctx, config = {}) {
224
249
  if (config.enabled === false) {
225
250
  ctx.logger?.info?.('[use-codex] disabled by configuration');
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dsh-use-codex",
3
3
  "displayName": "DSH Use Codex",
4
4
  "description": "通过 DeepSeek Harness 工具调用本机 Codex CLI 执行独立任务;danger-full-access 支持宿主许可 + 运行时开关双重授权。",
5
- "version": "0.4.0",
5
+ "version": "0.4.1",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
8
8
  "exports": {
@@ -52,5 +52,8 @@
52
52
  "homepage": "https://github.com/chaorenzeng/dsh-use-codex#readme",
53
53
  "bugs": {
54
54
  "url": "https://github.com/chaorenzeng/dsh-use-codex/issues"
55
+ },
56
+ "dependencies": {
57
+ "@deepseek-ai/schemastery": "^3.18.4"
55
58
  }
56
59
  }