@dsh-fly/dsh-plugin-fly-mode 0.1.2 → 0.1.4

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 (3) hide show
  1. package/README.md +47 -15
  2. package/cordis.patch.yml +185 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -6,7 +6,11 @@
6
6
 
7
7
  ## 它是什么 / 不是什么
8
8
 
9
- - **是**:一条 `- insert:` 声明(`id: preset-fly`,行表来自 `presets/fly/agent.cordis.yml`)。其中
9
+ - **是**:**两个 preset** 的声明(`- insert:`):
10
+ - **Fly 安全模式** `preset-fly`(行表来自 `dsh-fly` 的 `presets/fly/agent.cordis.yml`,41 行);
11
+ - **Fly 标准模式** `preset-fly-standard`(行表 = **上游 `standard` 的行表** + 一行 smart,33 行)——
12
+ 由生成器从**引擎自己的组合结果**里取上游行表(不手抄),所以引擎升级后行表跟着走、漂了 `--check` 会红。
13
+ 其中
10
14
  **7 个 Fly 工具**(binary / reverse / pwn / diag / recon / blackbox / guard)的源码**内联在包内
11
15
  `tools/`**,行表用**本包子路径**引用它们 —— 装这个包**不会**在 npm 上再拉这 7 个包;
12
16
  **`fly-smart` 单独一个 plugin**:它是本包 `dependencies` 里**唯一**一项,行表保持裸名,
@@ -14,7 +18,7 @@
14
18
  - **不是**:不带 `dsh.client`(模式是 agent 平面,没有浏览器半边);不带 Fly 工作台
15
19
  (console / diagnostics / netops / plugins / smart-panel 是各自独立的包);**不带**
16
20
  `dsh-plugin-fly-shell`(那会在别人的 UI 上再画一层 Fly 外壳)。
17
- - **不写 registry 的 `default:`**:默认模式归上游 `standard`。装上它 ≠ 默认变 fly —— fly
21
+ - **不写 registry 的 `default:`**:默认模式归上游 `standard`。装上它 ≠ 默认变 fly(或 fly-standard)——
18
22
  只是「设置 → Agent 预设」里多出来的一个可选模式。
19
23
  - **不含三模型路由**:`brainRoute` / `handRoute` / `reviewRoute` 是**用户机器**上的状态
20
24
  (`~/.dsh-fly/smart-routes.json`,面板写),本机那份值还是内网 provider。未被配置时工具会
@@ -32,21 +36,49 @@ node scripts/build-fly-mode-bundle.mjs --out ../dsh-plugins/dsh-plugin-fly-mode/
32
36
  (`pnpm setup:profile`)写进 `~/.dsh/profiles/fly/cordis.patch.yml` 的是**同一个函数**的输出。
33
37
  `--check` 用于门禁(漂移即红)。
34
38
 
35
- ## 发布前要做的两件
39
+ ## 发布(0.1.3 起走 tag → OIDC,自动带 provenance)
36
40
 
37
- 1. 8 个工具包目前都是 `private: true`(未发布)⇒ 先去掉它们的 `private` 并按同样方式发布,
38
- 否则本包的 `dependencies` 解析不到;本包自己的 `private: true` 也在那时拿掉。
39
- **`private: true` 不是发布闸门**(实测:`npm publish --dry-run` 一路走到鉴权才停,鉴权前
40
- 没有任何拦截)—— 它只是"别误装"的占位。真正的闸门是 `publishConfig` 里钉死的
41
- `registry: https://registry.npmjs.org/`:本机默认 registry 是**内网镜像**(`npm config get
42
- registry` = `pkgs.d.xiaomi.net/…/mi-npm/`),不钉的话 `npm publish` 会发到内网镜像去。
43
- 手敲发布也请带 `--registry=https://registry.npmjs.org/`。
44
- 2. `repository.url` 必须与跑发布 workflow 的仓库一致(npm `--provenance` 会校验;写错的失败
45
- 形状是"直接拒发",见 `dsh-fly/AGENTS.md` 坑表)。
41
+ - **以后每次发版**:升 `version` → 提交 → 打**注释 tag** → 推 tag;`.github/workflows/release.yml`
42
+ 会自动 `npm publish --access public --provenance` —— **不需要 token、不需要 2FA、不需要人工批准**。
43
+ 前提是包的「Settings → Trusted Publisher」按下面配好(**一次即可**):
44
+
45
+ ```
46
+ Publisher GitHub Actions
47
+ Organization or user ethanchen669
48
+ Repository dsh-plugin-fly-mode
49
+ Workflow filename release.yml ← 只写文件名,不是 workflow 里的 name:
50
+ Allowed actions ☑ Allow npm publish ← 不勾只会"暂存",npm publish 会"成功"但什么都不发
51
+ ```
52
+
53
+ 重推同一个 tag **不会**重跑 workflow ⇒ 要重跑就换一个新 tag。
54
+ - **首次发布(≤0.1.2)走的是另一条路**:包在 npm 上还不存在 ⇒ 没有 Trusted Publisher 页面可填,
55
+ 只能 `npm stage publish --access public` 再在网页上批准(`stage` 不需要 2FA)。
56
+ 0.1.0 / 0.1.1 已废弃,**0.1.2 是最后一个用 stage 发出去的版本**。
57
+ - **验收三件**(必须**换缓存键**再读:registry 的 packument 会被 CDN 缓存,反复查同一把钥匙只会读到第一次的结果):
58
+ ① `dist-tags.latest == 新版本`;② **`dist.attestations` 存在**(= provenance 成了);
59
+ ③ `readme` 是**发布那一刻**的快照(改了 README 要等下一次发版才上 npm 页面)。
60
+ - 发布前两条硬要求:`repository.url` 与跑 workflow 的仓库**逐字一致**(`--provenance` 会校验,写错**直接拒发**);
61
+ 发布目标钉在 `publishConfig.registry = https://registry.npmjs.org/` —— 本机默认 registry 是**内网镜像**。
62
+
63
+ ## 安装
64
+
65
+ ```bash
66
+ # CLI 路径(web 等 profile);cwd 必须是 DSH_HOME
67
+ cd ~/.dsh
68
+ dsh plugin --profile=web add @dsh-fly/dsh-plugin-fly-mode@0.1.3 --registry=https://registry.npmjs.org/
69
+ ```
70
+
71
+ - 装完**必须重启那个进程**:引擎把层与服务缓存在**进程内**,刷新页面不够。
72
+ - **官方桌面版**归 app 独占(`dsh plugin` 会拒:`profile "desktop" is managed exclusively by the
73
+ Electron application`)⇒ 在 `~/.dsh/profiles/desktop/` 里 `pnpm add …@0.1.3 --registry=…`,
74
+ 并且要把包名加进 `package.json` 的 **`dsh.profile.bundles`** —— 那一条才让它成为一层
75
+ (只写 `dependencies` 是不会生效的)。
46
76
 
47
77
  ## 仓库状态(2026-10-11)
48
78
 
49
- - 本仓刚落地:`cordis.patch.yml`(生成)、`package.json`、本 README。
50
- - `.github/workflows/{ci,release}.yml` 是从 `@dsh-fly/dsh-plugin-fly-skins` 仓**抄来的模板,
51
- 尚未适配**(里面的包名/路径/构建步骤还是皮肤那套)—— 适配是发布前的一步,别直接推它去跑。
79
+ - 形状定稿:一条 `- insert:` 声明 + 包内 `tools/`(7 个工具内联,行表用本包子路径引用)+
80
+ `dsh-plugin-fly-smart` 作为**唯一** npm 依赖。声明由 `dsh-fly` 仓的
81
+ `scripts/build-fly-mode-bundle.mjs` 生成,门禁用 `--check` 断漂移(含多出来的文件)。
82
+ - `.github/workflows/{ci,release}.yml` **已适配本仓**(纯声明包:不装依赖、直接跑
83
+ `node scripts/verify.mjs`),CI 已在公开仓实测全绿,含 `fetch-depth: 0` 的**全历史署名硬门**。
52
84
  - 身份已按规范设好(仓级 `user.email = ethanchen669@users.noreply.github.com`)。
package/cordis.patch.yml CHANGED
@@ -1,8 +1,11 @@
1
1
  # 由仓库脚本生成,别手改:node scripts/build-fly-mode-bundle.mjs --out <本文件>
2
- # 同源:这段声明来自 scripts/lib/fly-profile.mjs 的 seedAgentPreset()(dev 装配写进 profile 的
2
+ # 两个 preset:Fly 安全模式(preset-fly,7 个安全工具内联 + smart)与
3
+ # Fly 标准模式(preset-fly-standard,上游 standard 的行表 + 同一行 smart,无安全工具)。
4
+ # 同源:安全模式那段声明来自 scripts/lib/fly-profile.mjs 的 seedAgentPreset()(dev 装配写进 profile 的
3
5
  # 是同一条);8 个工具的行名被改写成**本包的子路径**(tools/**,随包一起发布)。
4
6
  # 门禁用 --check 断言本文件与 tools/** 都 == 生成器输出。
5
7
  # 不含三模型路由(用户机器状态)、不写 registry default(默认归上游 standard)。
8
+ - insert:
6
9
  - insert:
7
10
  - id: preset-fly
8
11
  name: '@deepseek-ai/dsh-agent-preset'
@@ -397,3 +400,184 @@
397
400
  - id: tool-fly-guard
398
401
  name: '@dsh-fly/dsh-plugin-fly-mode/tools/dsh-plugin-fly-guard/index.js'
399
402
  # <<< fly-agent-preset
403
+ - insert:
404
+ - id: preset-fly-standard
405
+ name: '@deepseek-ai/dsh-agent-preset'
406
+ config:
407
+ id: fly-standard
408
+ name: "Fly 标准"
409
+ description: "上游 standard 的全部行 + Fly smart 工作流(不含安全工具链)。"
410
+ order: 11
411
+ plugins:
412
+ - id: persona
413
+ name: '@deepseek-ai/dsh-persona'
414
+ config:
415
+ suffix: Your working directory is {{cwd}}.
416
+ prefix: You are a coding agent powered by the {{model}} model.
417
+ - id: agent-instructions
418
+ name: '@deepseek-ai/dsh-agent-instructions'
419
+ config:
420
+ maxBytes: 65536
421
+ - id: tool-bash
422
+ name: '@deepseek-ai/dsh-tool-bash'
423
+ disabled: !!js process.platform === 'win32'
424
+ - id: tool-pwsh
425
+ name: '@deepseek-ai/dsh-tool-pwsh'
426
+ disabled: !!js process.platform !== 'win32'
427
+ - id: tool-fs
428
+ name: '@deepseek-ai/dsh-tool-fs'
429
+ - id: tool-fs-search
430
+ name: '@deepseek-ai/dsh-tool-fs-search'
431
+ config:
432
+ sampleOverCapGlobResults: false
433
+ - id: tool-jobs
434
+ name: '@deepseek-ai/dsh-tool-jobs'
435
+ - id: skill-filesystem
436
+ name: '@deepseek-ai/dsh-skill-filesystem'
437
+ - id: tool-skill
438
+ name: '@deepseek-ai/dsh-tool-skill'
439
+ - id: command-goal
440
+ name: '@deepseek-ai/dsh-command-goal'
441
+ - id: tool-goal
442
+ name: '@deepseek-ai/dsh-tool-goal'
443
+ - id: planning
444
+ name: cordis:group
445
+ group: true
446
+ isolate:
447
+ planMode: true
448
+ config:
449
+ - id: plan-mode
450
+ name: '@deepseek-ai/dsh-plan-mode'
451
+ config:
452
+ section: >
453
+ You are in plan mode. Stay in plan mode until exit_plan_mode
454
+ succeeds or the user switches the session mode. Imperative
455
+ language to implement changes means plan the implementation, not
456
+ execute it. A user's conversational agreement — including an
457
+ answer confirming something you asked — approves nothing and
458
+ does not end plan mode; fold the confirmed decision into the
459
+ plan and submit it through exit_plan_mode.
460
+ Explore first. Use non-mutating reads, searches, static
461
+ analysis, and checks to ground the plan in the actual
462
+ repository. Do not edit or write files, change configuration,
463
+ run formatters or code generation that rewrites tracked files,
464
+ commit, or otherwise carry out the plan. Prefer existing
465
+ functions and patterns over new machinery.
466
+ The tool catalog stays the same across modes for request-cache
467
+ stability. These plan-mode rules override any later tool
468
+ description or guidance that suggests using mutation tools;
469
+ those tools remain listed to keep the tool catalog unchanged. Do
470
+ not use todo_write to track this planning phase: it tracks
471
+ implementation after an approved plan, while the plan itself
472
+ belongs in exit_plan_mode.
473
+ Resolve discoverable facts by inspection. Use ask_user_question
474
+ only for user-owned choices or material ambiguity that
475
+ inspection cannot answer. Do not ask the user where code lives
476
+ or how current behavior works when you can find out.
477
+ Make the plan decision-complete: state the goal and success
478
+ criteria; group implementation changes by subsystem; identify
479
+ public API, schema, and data-flow changes; cover edge cases,
480
+ failure modes, tests, acceptance criteria, and explicit
481
+ assumptions. Keep it concise enough to review but detailed
482
+ enough that another engineer can implement it without making
483
+ design decisions.
484
+ When ready, call exit_plan_mode with the complete plan markdown,
485
+ starting with a # title. Make exit_plan_mode the only and final
486
+ tool call in that assistant response: it presents the plan for
487
+ approval, and implementation begins only in a later step after
488
+ approval. Do not paste the final plan as a plain reply or ask
489
+ "should I proceed?" through prose or ask_user_question. If
490
+ review rejects it, incorporate the feedback and present again.
491
+ If the review channel is unavailable or aborted, stay in plan
492
+ mode and ask the user to switch modes manually; do not proceed
493
+ with implementation.
494
+ - id: compaction
495
+ name: cordis:group
496
+ group: true
497
+ isolate:
498
+ compaction: true
499
+ toolResultPruner: true
500
+ config:
501
+ - id: compaction-basic
502
+ name: '@deepseek-ai/dsh-compaction-basic'
503
+ - id: command-compact
504
+ name: '@deepseek-ai/dsh-command-compact'
505
+ - id: tool-result-pruner
506
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
507
+ config:
508
+ thresholdChars: 8192
509
+ headChars: 4096
510
+ tailChars: 1024
511
+ - id: delegation
512
+ name: cordis:group
513
+ group: true
514
+ isolate:
515
+ workflowEngine: true
516
+ config:
517
+ - id: tool-subagent-control
518
+ name: '@deepseek-ai/dsh-tool-subagent-control'
519
+ - id: tool-subagent-list-agents
520
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
521
+ - id: tool-subagent
522
+ name: '@deepseek-ai/dsh-tool-subagent'
523
+ config:
524
+ provider: spawn
525
+ toolName: subagent
526
+ modelSelectionSettings: true
527
+ backgroundMode: continuable
528
+ - id: tool-subagent-fork
529
+ name: '@deepseek-ai/dsh-tool-subagent'
530
+ config:
531
+ provider: fork
532
+ toolName: subagent_fork
533
+ backgroundMode: continuable
534
+ - id: tool-subagent-codex
535
+ name: '@deepseek-ai/dsh-tool-subagent'
536
+ disabled: true
537
+ config:
538
+ provider: codex
539
+ toolName: subagent_codex
540
+ backgroundMode: one-shot
541
+ maxDepth: provider-managed
542
+ - id: tool-subagent-claude-code
543
+ name: '@deepseek-ai/dsh-tool-subagent'
544
+ disabled: true
545
+ config:
546
+ provider: claude-code
547
+ toolName: subagent_claude_code
548
+ backgroundMode: one-shot
549
+ maxDepth: provider-managed
550
+ - id: workflow-ptc
551
+ name: '@deepseek-ai/dsh-workflow-ptc'
552
+ config:
553
+ provider: spawn
554
+ - id: tool-workflow
555
+ name: '@deepseek-ai/dsh-tool-workflow'
556
+ - id: tool-ralph
557
+ name: '@deepseek-ai/dsh-tool-ralph'
558
+ disabled: true
559
+ config:
560
+ subagentProvider: spawn
561
+ maxRounds: 64
562
+ - id: tool-ask-user
563
+ name: '@deepseek-ai/dsh-tool-ask-user'
564
+ - id: tool-todo
565
+ name: '@deepseek-ai/dsh-tool-todo'
566
+ config:
567
+ allowParallelInProgress: true
568
+ - id: tool-web
569
+ name: '@deepseek-ai/dsh-tool-web'
570
+ config:
571
+ fetch: true
572
+ searchTimeoutMs: 60000
573
+ - id: present
574
+ name: '@deepseek-ai/dsh-tool-present'
575
+ - id: tool-plugin-manager
576
+ name: '@deepseek-ai/dsh-plugin-manager/tools'
577
+ disabled: true
578
+ - id: tool-fly-smart
579
+ name: dsh-plugin-fly-smart
580
+ config:
581
+ enabled: true
582
+ maxRework: 5
583
+ requireConsult: true
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dsh-fly/dsh-plugin-fly-mode",
3
- "version": "0.1.2",
4
- "description": "Fly 安全模式(agent preset `fly`)作为一个可安装的包:自带 7 个 Fly 工具(源码内联在包内 tools/,行表用本包子路径引用),并依赖单独发布的 dsh-plugin-fly-smart;装进任何 profile 后那里就能服务 fly preset。",
3
+ "version": "0.1.4",
4
+ "description": "Fly 模式作为一个可安装的包:**两个 preset** —— Fly 安全模式(preset-fly,7 个安全工具内联 + smart)与 Fly 标准模式(preset-fly-standard,上游 standard 的行表 + smart,无安全工具);依赖单独发布的 dsh-plugin-fly-smart。",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {