dsh-ops 0.0.0-stage → 0.2.2

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 (140) hide show
  1. package/CHANGELOG.md +202 -0
  2. package/LICENSE +30 -0
  3. package/NOTICE +106 -0
  4. package/PROVENANCE.md +435 -0
  5. package/README.en.md +126 -0
  6. package/README.md +115 -2
  7. package/README.zh.md +116 -0
  8. package/bin/dsh-ops.mjs +1216 -0
  9. package/cordis.patch.yml +160 -0
  10. package/docs/manual-validation.md +53 -0
  11. package/docs/release-0.2.1.md +72 -0
  12. package/docs/schema-baseline.json +64 -0
  13. package/docs/schema-current.json +84 -0
  14. package/docs/schema-measurement.md +17 -0
  15. package/dsh-plugin.json +88 -0
  16. package/icon.svg +12 -0
  17. package/lib/binary.js +409 -0
  18. package/lib/config.js +198 -0
  19. package/lib/handshake.js +252 -0
  20. package/lib/index.js +108 -0
  21. package/lib/jobs.js +42 -0
  22. package/lib/policy.js +64 -0
  23. package/lib/presentation.js +63 -0
  24. package/lib/profile-install.js +61 -0
  25. package/lib/rust.js +194 -0
  26. package/lib/session-shells.js +78 -0
  27. package/lib/shells.js +998 -0
  28. package/lib/tools.js +657 -0
  29. package/locale/en.json +6 -0
  30. package/locale/zh.json +6 -0
  31. package/package.json +114 -4
  32. package/vendor/fastctx/Cargo.lock +3210 -0
  33. package/vendor/fastctx/Cargo.toml +94 -0
  34. package/vendor/fastctx/FORK.md +119 -0
  35. package/vendor/fastctx/LICENSE-APACHE +201 -0
  36. package/vendor/fastctx/NOTICE +40 -0
  37. package/vendor/fastctx/README.md +439 -0
  38. package/vendor/fastctx/THIRD_PARTY_LICENSES.md +17 -0
  39. package/vendor/fastctx/THIRD_PARTY_LICENSES_RUST.md +7914 -0
  40. package/vendor/fastctx/UPSTREAM.md +49 -0
  41. package/vendor/fastctx/build.rs +413 -0
  42. package/vendor/fastctx/src/background_status.rs +403 -0
  43. package/vendor/fastctx/src/binary.rs +75 -0
  44. package/vendor/fastctx/src/bounded_sort.rs +500 -0
  45. package/vendor/fastctx/src/budget.rs +781 -0
  46. package/vendor/fastctx/src/cli/mod.rs +110 -0
  47. package/vendor/fastctx/src/context_guard.rs +289 -0
  48. package/vendor/fastctx/src/control/mod.rs +6 -0
  49. package/vendor/fastctx/src/control/paths.rs +49 -0
  50. package/vendor/fastctx/src/control/settings.rs +753 -0
  51. package/vendor/fastctx/src/control/transaction.rs +531 -0
  52. package/vendor/fastctx/src/edit/document.rs +535 -0
  53. package/vendor/fastctx/src/edit/locks.rs +371 -0
  54. package/vendor/fastctx/src/edit/mod.rs +213 -0
  55. package/vendor/fastctx/src/edit/private_storage/unix.rs +315 -0
  56. package/vendor/fastctx/src/edit/private_storage/windows.rs +793 -0
  57. package/vendor/fastctx/src/edit/private_storage.rs +234 -0
  58. package/vendor/fastctx/src/edit/replace.rs +1030 -0
  59. package/vendor/fastctx/src/edit_server.rs +53 -0
  60. package/vendor/fastctx/src/encoding/reference_v011.rs +587 -0
  61. package/vendor/fastctx/src/encoding/snapshot_pipeline.rs +1678 -0
  62. package/vendor/fastctx/src/encoding.rs +1118 -0
  63. package/vendor/fastctx/src/file_executor.rs +1151 -0
  64. package/vendor/fastctx/src/file_snapshot.rs +1491 -0
  65. package/vendor/fastctx/src/glob_filter.rs +98 -0
  66. package/vendor/fastctx/src/glob_tool.rs +653 -0
  67. package/vendor/fastctx/src/grep_sink.rs +1162 -0
  68. package/vendor/fastctx/src/grep_tool.rs +2449 -0
  69. package/vendor/fastctx/src/lib.rs +45 -0
  70. package/vendor/fastctx/src/main.rs +15 -0
  71. package/vendor/fastctx/src/model.rs +51 -0
  72. package/vendor/fastctx/src/model_guidance.rs +62 -0
  73. package/vendor/fastctx/src/operation.rs +356 -0
  74. package/vendor/fastctx/src/ordered_window.rs +1235 -0
  75. package/vendor/fastctx/src/os_environment.rs +414 -0
  76. package/vendor/fastctx/src/path_codec.rs +850 -0
  77. package/vendor/fastctx/src/paths.rs +244 -0
  78. package/vendor/fastctx/src/process_identity.rs +763 -0
  79. package/vendor/fastctx/src/process_policy.rs +74 -0
  80. package/vendor/fastctx/src/read_tool/batch.rs +496 -0
  81. package/vendor/fastctx/src/read_tool/hex_file.rs +141 -0
  82. package/vendor/fastctx/src/read_tool/image_file.rs +88 -0
  83. package/vendor/fastctx/src/read_tool/mod.rs +245 -0
  84. package/vendor/fastctx/src/read_tool/pdf.rs +470 -0
  85. package/vendor/fastctx/src/read_tool/pdf_disabled.rs +47 -0
  86. package/vendor/fastctx/src/read_tool/pdf_engine.rs +664 -0
  87. package/vendor/fastctx/src/read_tool/text_file.rs +351 -0
  88. package/vendor/fastctx/src/render_plan.rs +468 -0
  89. package/vendor/fastctx/src/runtime/activity.rs +159 -0
  90. package/vendor/fastctx/src/runtime/hosts.rs +99 -0
  91. package/vendor/fastctx/src/runtime/journal.rs +556 -0
  92. package/vendor/fastctx/src/runtime/local_ipc.rs +186 -0
  93. package/vendor/fastctx/src/runtime/mod.rs +746 -0
  94. package/vendor/fastctx/src/runtime/protocol.rs +296 -0
  95. package/vendor/fastctx/src/runtime/session.rs +536 -0
  96. package/vendor/fastctx/src/runtime/windows_process.rs +66 -0
  97. package/vendor/fastctx/src/search_parallelism.rs +106 -0
  98. package/vendor/fastctx/src/search_text.rs +227 -0
  99. package/vendor/fastctx/src/server.rs +359 -0
  100. package/vendor/fastctx/src/server_manifest.rs +468 -0
  101. package/vendor/fastctx/src/server_support.rs +826 -0
  102. package/vendor/fastctx/src/session.rs +629 -0
  103. package/vendor/fastctx/src/shell/apply_patch_hint.rs +41 -0
  104. package/vendor/fastctx/src/shell/bash.rs +263 -0
  105. package/vendor/fastctx/src/shell/buffer.rs +108 -0
  106. package/vendor/fastctx/src/shell/encoding.rs +403 -0
  107. package/vendor/fastctx/src/shell/foreground.rs +115 -0
  108. package/vendor/fastctx/src/shell/jobs/admission.rs +91 -0
  109. package/vendor/fastctx/src/shell/jobs/background.rs +146 -0
  110. package/vendor/fastctx/src/shell/jobs/host.rs +830 -0
  111. package/vendor/fastctx/src/shell/jobs/identity.rs +29 -0
  112. package/vendor/fastctx/src/shell/jobs/mod.rs +1513 -0
  113. package/vendor/fastctx/src/shell/jobs/model.rs +244 -0
  114. package/vendor/fastctx/src/shell/jobs/output_log.rs +1148 -0
  115. package/vendor/fastctx/src/shell/jobs/store.rs +1300 -0
  116. package/vendor/fastctx/src/shell/mod.rs +345 -0
  117. package/vendor/fastctx/src/shell/normalize.rs +389 -0
  118. package/vendor/fastctx/src/shell/output.rs +406 -0
  119. package/vendor/fastctx/src/shell/process.rs +493 -0
  120. package/vendor/fastctx/src/shell_server.rs +156 -0
  121. package/vendor/fastctx/src/skip_report.rs +83 -0
  122. package/vendor/fastctx/src/stdio_transport.rs +177 -0
  123. package/vendor/fastctx/src/tool_schema.rs +204 -0
  124. package/vendor/fastctx/src/traversal.rs +846 -0
  125. package/vendor/fastctx/third-party/pdfium-7763/LICENSE +9 -0
  126. package/vendor/fastctx/third-party/pdfium-7763/licenses/abseil.txt +202 -0
  127. package/vendor/fastctx/third-party/pdfium-7763/licenses/agg23.txt +14 -0
  128. package/vendor/fastctx/third-party/pdfium-7763/licenses/fast_float.txt +27 -0
  129. package/vendor/fastctx/third-party/pdfium-7763/licenses/freetype.txt +169 -0
  130. package/vendor/fastctx/third-party/pdfium-7763/licenses/icu.txt +542 -0
  131. package/vendor/fastctx/third-party/pdfium-7763/licenses/lcms.txt +27 -0
  132. package/vendor/fastctx/third-party/pdfium-7763/licenses/libjpeg_turbo.ijg +260 -0
  133. package/vendor/fastctx/third-party/pdfium-7763/licenses/libjpeg_turbo.md +135 -0
  134. package/vendor/fastctx/third-party/pdfium-7763/licenses/libopenjpeg.txt +32 -0
  135. package/vendor/fastctx/third-party/pdfium-7763/licenses/libpng.txt +134 -0
  136. package/vendor/fastctx/third-party/pdfium-7763/licenses/libtiff.txt +21 -0
  137. package/vendor/fastctx/third-party/pdfium-7763/licenses/llvm-libc.txt +278 -0
  138. package/vendor/fastctx/third-party/pdfium-7763/licenses/pdfium.txt +230 -0
  139. package/vendor/fastctx/third-party/pdfium-7763/licenses/simdutf.txt +18 -0
  140. package/vendor/fastctx/third-party/pdfium-7763/licenses/zlib.txt +29 -0
@@ -0,0 +1,94 @@
1
+ [package]
2
+ name = "fastctx"
3
+ version = "0.2.6"
4
+ edition = "2024"
5
+ rust-version = "1.88"
6
+ description = "FastCtx — fast, context-efficient repository tools for AI agents."
7
+ authors = ["yc-duan <dy2958830371@gmail.com>"]
8
+ license = "Apache-2.0"
9
+ repository = "https://github.com/yc-duan/fastctx"
10
+ readme = "README.md"
11
+ documentation = "https://docs.rs/fastctx"
12
+ keywords = ["mcp", "codex", "ripgrep", "filesystem"]
13
+ categories = ["command-line-utilities", "development-tools"]
14
+ include = [
15
+ "/build.rs",
16
+ "/src/**",
17
+ "/tests/**",
18
+ "/README.md",
19
+ "/LICENSE-APACHE",
20
+ "/NOTICE",
21
+ "/THIRD_PARTY_LICENSES.md",
22
+ "/THIRD_PARTY_LICENSES_RUST.md",
23
+ "/third-party/**",
24
+ ]
25
+
26
+ [features]
27
+ default = ["pdf"]
28
+ pdf = ["dep:pdfium-render"]
29
+
30
+ [dependencies]
31
+ base64 = "0.22.1"
32
+ bpe-openai = "0.3.0"
33
+ chardetng = "1.0.0"
34
+ clap = { version = "4.5.53", features = ["derive"] }
35
+ crossterm = "0.29.0"
36
+ dunce = "1.0.5"
37
+ encoding_rs = "0.8.35"
38
+ flate2 = "1.1.5"
39
+ fs2 = "0.4.3"
40
+ globset = "0.4.18"
41
+ grep-matcher = "0.1.8"
42
+ grep-regex = "0.1.14"
43
+ grep-searcher = "0.1.16"
44
+ hex = "0.4.3"
45
+ ignore = "0.4.28"
46
+ image = { version = "0.25.8", default-features = false, features = ["bmp", "gif", "jpeg", "png", "webp"] }
47
+ parking_lot = "0.12.5"
48
+ pdfium-render = { version = "=0.9.2", optional = true, default-features = false, features = ["image_025", "pdfium_7763", "thread_safe"] }
49
+ process-wrap = { version = "9.1.0", default-features = false, features = ["std", "job-object", "process-session"] }
50
+ ratatui = { version = "0.30.2", default-features = false, features = ["crossterm_0_29"] }
51
+ rayon = "1.11.0"
52
+ regex = "1.12.2"
53
+ regex-syntax = "0.8.11"
54
+ rmcp = { version = "=2.2.0", features = ["transport-io"] }
55
+ schemars = "1.2.1"
56
+ semver = "1.0.28"
57
+ serde = { version = "1.0.228", features = ["derive"] }
58
+ serde_json = "1.0.145"
59
+ sha2 = "0.10.9"
60
+ strsim = "0.11.1"
61
+ sys-locale = "0.3.2"
62
+ tar = "0.4.44"
63
+ time = { version = "0.3.53", features = ["formatting", "macros", "parsing"] }
64
+ tokio = { version = "1.48.0", features = ["io-util", "macros", "net", "rt-multi-thread", "signal", "sync", "time"] }
65
+ tokio-util = { version = "0.7.18", features = ["rt"] }
66
+ toml_edit = { version = "0.22.27", features = ["serde"] }
67
+ tempfile = "3.23.0"
68
+ ureq = { version = "2.12.1", default-features = false, features = ["tls"] }
69
+ url = "2.5.8"
70
+ walkdir = "2.5.0"
71
+ zip = { version = "2.4.2", default-features = false, features = ["deflate"] }
72
+
73
+ [target.'cfg(unix)'.dependencies]
74
+ libc = "0.2.186"
75
+
76
+ [target.'cfg(windows)'.dependencies]
77
+ windows-sys = { version = "0.61.2", features = ["Win32_Foundation", "Win32_Globalization", "Win32_Security", "Win32_Security_Authorization", "Win32_Storage_FileSystem", "Win32_System_Console", "Win32_System_Diagnostics_ToolHelp", "Win32_System_IO", "Win32_System_JobObjects", "Win32_System_Pipes", "Win32_System_ProcessStatus", "Win32_System_Registry", "Win32_System_Threading"] }
78
+
79
+ [build-dependencies]
80
+ flate2 = "1.1.5"
81
+ hex = "0.4.3"
82
+ sha2 = "0.10.9"
83
+ tar = "0.4.44"
84
+ ureq = { version = "2.12.1", default-features = false, features = ["tls"] }
85
+
86
+ [dev-dependencies]
87
+ filetime = "0.2.26"
88
+ lopdf = { version = "0.44.0", default-features = false }
89
+ tiktoken-rs = "0.12.0"
90
+
91
+ [profile.release]
92
+ codegen-units = 1
93
+ lto = "thin"
94
+ strip = true
@@ -0,0 +1,119 @@
1
+ # Vendored FastCtx — what this repository changed
2
+
3
+ Upstream provenance is in `UPSTREAM.md`. This file records every difference from
4
+ the upstream commit recorded there.
5
+
6
+ The rule this directory follows is Apache-2.0 §4(b): a modified file carries a
7
+ prominent notice that it was changed. **`src/` is not untouched.** Besides the
8
+ removals listed below, this distribution also cuts standalone-product code out of
9
+ files it keeps, and every such file carries the notice on its first line. The
10
+ deletions are the only functional change: the MCP server's tool behaviour,
11
+ protocol, output formats, and every limit value stay exactly as upstream wrote
12
+ them. `Cargo.toml`, `Cargo.lock`, `build.rs`, `tools/`, `third-party/`, and the
13
+ licence/NOTICE files are unchanged.
14
+
15
+ Three model-visible strings that named Codex — the `run_background` description,
16
+ the stale-session error, and the `apply_patch` misuse note — were reworded to be
17
+ host-neutral, and the frozen description golden in `tests/server_contract.rs` was
18
+ updated to match. No tool behaviour, schema, protocol field, or limit value
19
+ changed. Modified test files carry the same notice as modified source files.
20
+
21
+ ## Removed
22
+
23
+ | Path | Why it is not part of this distribution |
24
+ | --- | --- |
25
+ | `.github/` | Upstream CI and release workflows. They build and publish upstream's npm packages and GitHub Releases; this repository publishes neither, and a workflow file that cannot run here is a broken promise rather than a feature. |
26
+ | `packages/` | Upstream's npm distribution layer: the `fastctx` launcher package, the `codex-fastctx` package, and the five `@fastctx/<platform>` binary packages. This plugin does not use upstream's launcher — the DSH plugin mounts `fastctx serve` directly through the harness MCP bridge — and a vendored copy of a published package would silently shadow the published one. The published packages are still consumed as `optionalDependencies`. |
27
+ | `scripts/` | Upstream's PowerShell release and staging scripts (`stage-npm-package.ps1`, `pack-npm-root.ps1`, `verify-release-*.ps1`, `finalize-release-assets.ps1`, `stage-release-archive.ps1`, `verify-distribution-contract.ps1`, `verify-npm-install.ps1`, `drain-test-processes.ps1`) plus `verify-launcher-lifecycle.js`. All of them exist to produce or verify the npm/GitHub-Release artifacts that were removed with `packages/` and `.github/`. |
28
+ | `src/tui/` — 9 files, 8,414 lines | The control terminal (`app`, `view`, `config`, `jobs`, `migration`, `mod`, `theme`, `update`, `budget_editor`). This distribution is a pure MCP server binary: nothing reaches a full-screen TUI, and its only entry points (`fastctx ui`, the implicit TTY mode, the update-finalize/failure hand-off) are gone with it. |
29
+ | `src/update/` — 6 files, 4,331 lines | The self-updater and upstream update detection (`check`, `cache`, `helper`, `model`, `mod`, `npm_invocation`), including the `UpdateHelper` helper binary path and the proxy/registry probes against npm. `fastctx serve` neither checks for nor installs updates; the launcher packages that consumed this were already removed. |
30
+ | `src/control/agents.rs`, `apply.rs`, `codex_config.rs`, `config_i18n.rs`, `doctor.rs`, `guard_i18n.rs`, `i18n.rs`, `job_i18n.rs`, `leftovers.rs`, `link.rs`, `processes.rs`, `provider.rs` — 12 files, 9,144 lines | The ChatGPT/Codex integration (managed AGENTS.md blocks, Codex `config.toml` writing, AGENTS-link status, installed-process discovery, stale-binary cleanup), the Apply/Unapply transaction planner, the doctor, the read-only Codex provider detection that selected the Guarded output policy, and the 17-language catalogs (including the config/job/guard catalogs). All of it exists to install or describe the standalone product; `serve` needs none of it. |
31
+ | `tests/cli_apply_golden.rs` (91 lines) | Golden output of the removed `apply` command. |
32
+ | `tests/cli_contract.rs` (551 lines) | Contract tests for `apply`, `unapply`, `status`/`doctor`, `--codex-home`, and `jobs kill` — every one of them a removed command. |
33
+ | `tests/guarded_burst_contract.rs` (55 lines) | End-to-end test of the provider-driven Guarded burst pool, whose trigger was `provider.rs`. |
34
+
35
+ ### Removed from files that stay
36
+
37
+ | File | What was cut, and why |
38
+ | --- | --- |
39
+ | `src/lib.rs` | `pub mod tui;` and `pub(crate) mod update;`, and the crate doc line no longer names ChatGPT and Codex. |
40
+ | `src/main.rs` | The "dual-mode MCP, CLI, and TUI" doc line: the binary is now the MCP server plus its internal child-process entry points. |
41
+ | `src/cli/mod.rs` | The `Ui`, `Apply`, `Unapply`, `Status`, `Lang`, `Jobs`, and `UpdateHelper` subcommands, every `run_tui*` path, the TTY/implicit-TUI dispatch, `require_tty`, `confirm`, the preview/receipt printers, and the `UPDATE_FINALIZE_ENV`/`UPDATE_FAILURE_ENV` startup hooks together with the `ControlPaths::discover()` + `crate::update::cleanup_replaced_binaries` call. What remains is `serve` (still the default with no subcommand) and the internal `JobBootstrap`/`JobHost`/`JobWatch`/`RuntimeBootstrap`/`RuntimeHost` entries. |
42
+ | `src/control/mod.rs` | Module list reduced to `paths`, `settings`, `transaction`. |
43
+ | `src/control/paths.rs` | `CodexHomeSource`, `discover`, `discover_with_codex_home`, `for_home_and_codex_home`, and the `codex_dir`/`codex_config`/`codex_agents`/`codex_home_source`/`fastctx_bin_dir`/`installed_binary` fields — all of them Codex-profile or self-install state that only the deleted modules read. |
44
+ | `src/control/settings.rs` | `UpdateSettings`/`UpdateSource`/`UpdateSettingsStatus`, the `language` field and its 17-language validation, `OutputGuardSettings`, `AppliedRecord`/`ManagedFileRecord`/the whole Apply receipt, the legacy `fastedit`/`FeatureToggle` key, `load_for_startup`/`StartupSettings`/`encode_startup_normalization`/`TOOL_BUDGET_EPOCH` (the startup normaliser, which only the TUI and the CLI commands ran — the server never wrote the config file), the Status-only `job_limit_status`, `update_settings_status`, `search_parallelism_status`, and `reset_user_preferences`, plus the TUI-only `Tier::as_str`/`display_name`/`previous`/`next` and its `clap::ValueEnum` derive, and `ToolBudgetLevel::label`/`percent`/`ceiling`. |
45
+ | `src/control/transaction.rs` | `FileAction::Delete`, the `locked_binary_fallback` flag and the Windows replace-the-running-binary fallback, and `validate` (documented as Unapply-only). Every surviving caller writes files. |
46
+ | `src/session.rs` | The Codex provider detection call, the `provider: ProviderDetection` field, the `CODEX_HOME` lookup, and the `EffectiveOutput`/`EffectiveOutputMode`/`effective_output` definitions that moved here from `provider.rs`. The one test that pinned the Guarded overlay became a test of the selected-tier policy. |
47
+ | `src/budget.rs` | Nothing was cut: `GUARDED_HOST_LIMIT` (10,000) and `GUARDED_FASTCTX_BUDGET` (9,000) moved here verbatim from the deleted `control/provider.rs`, values unchanged. |
48
+ | `src/server_support.rs` | Only the guarded-accounting test's path to the budget constant (`crate::budget::GUARDED_FASTCTX_BUDGET`). The burst layer itself is unchanged. |
49
+ | `src/shell_server.rs` | The `run_background` description no longer names Codex as a restart partner. |
50
+ | `src/edit/document.rs` | The removed `atomic_replace` argument. |
51
+ | `src/edit/private_storage.rs` | `update_check_directory`, whose only caller was the update cache. |
52
+ | `src/search_parallelism.rs` | `SearchParallelismInputError` and `parse_input`, the TUI's editable CPU-limit parser, together with its test. |
53
+ | `src/shell/apply_patch_hint.rs` | The `apply_patch` misuse note points at the host's own tool instead of Codex's built-in shell. |
54
+ | `src/shell/bash.rs` | `probe_bash`, the uncached Apply-preflight probe. |
55
+ | `src/shell/jobs/admission.rs` | `advance_generation` and its `generation_path` field, which only Unapply published to invalidate older servers. |
56
+ | `src/shell/jobs/mod.rs` | The TUI tail reader (`JobTail`, `TailCursor`, `refresh_tail`), the Apply/Unapply helpers (`acquire_unapply_admission`, `kill_all_running`) and the removed `fastctx jobs kill` wrapper (`kill_for_control`), the permission-denied classification only the TUI read, and the test that drove `advance_generation`. The stale-session message no longer names Unapply or ChatGPT/Codex. |
57
+ | `src/shell/jobs/store.rs` | The incremental tail reader (`LogDelta`, `read_log_delta`, `read_legacy_spool_delta`) and its three tests; the direct and legacy log readers that `job_output` uses are untouched. |
58
+ | `src/shell/jobs/output_log.rs` | `record_end` and `log_len` (only the deleted tail reader called them). `read_range` is kept but is now `#[cfg(test)]`: the serve path reads through `read_prefix_bounded`/`read_suffix_bounded`, and the reader tests below pin index decoding through it. |
59
+ | `tests/server_contract.rs` | The frozen `run_background` description golden, updated to match `src/shell_server.rs`. |
60
+ | `tests/runtime_control_center.rs` | `runtime_guard_tightens_without_apply_and_releases_on_the_next_connection`, the test whose whole subject was the removed Guarded policy. |
61
+
62
+ ## Kept deliberately
63
+
64
+ - `src/`, `tests/`, `tools/`, `third-party/`, `build.rs`, `Cargo.toml`,
65
+ `Cargo.lock`, `deny.toml`, `about.toml`, `about.hbs`, and the licence/NOTICE
66
+ files — the runtime and its own verification.
67
+ - The guarded-burst machinery: `context_guard::GuardedBurstPool`, the burst layer
68
+ in `src/server_support.rs`, `SessionContext::begin_guarded_response`, and the
69
+ `Guard`ed variant of the output-mode enum. With provider detection gone nothing
70
+ can select Guarded, so they are inert — but they are MCP server response
71
+ plumbing rather than a standalone-product surface, they are a byte-for-byte
72
+ pass-through when no ticket exists (which is now always), and rewriting the
73
+ response path would change the implementation this distribution is supposed to
74
+ leave alone. The Guarded ceilings keep their upstream values in
75
+ `src/budget.rs`.
76
+ - `README.md`, `README.zh-CN.md`, `CONTRIBUTING.md` — upstream's own
77
+ documentation, unedited. They describe upstream's product, including the
78
+ installation paths and commands this distribution does not use (the TUI, the
79
+ updater, `apply`/`unapply`/`status`); the repository README describes this
80
+ distribution.
81
+
82
+ ## Added here
83
+
84
+ | Path | License |
85
+ | --- | --- |
86
+ | `FORK.md` (this file) | MIT — this repository's own work |
87
+ | `UPSTREAM.md` | MIT — this repository's own work |
88
+
89
+ ## Not changed, and the reason that matters
90
+
91
+ The `pdf` Cargo feature is left at its upstream default (enabled), so
92
+ `inspect_local_file` can read PDF text layers and render pages exactly as
93
+ upstream does. `build.rs` downloads and verifies the pinned Pdfium artifact on
94
+ first build; passing `--no-default-features` to `cargo build` disables it at the
95
+ cost of PDF support.
96
+
97
+ ## Dependencies that are now declared but unused
98
+
99
+ `Cargo.toml` and `Cargo.lock` are deliberately unchanged so `cargo build --locked`
100
+ keeps working, so these stay declared even though no remaining source file names
101
+ them. Each one was used only by a module deleted above:
102
+
103
+ `crossterm`, `ratatui` (the control terminal), `walkdir` (its file browser),
104
+ `sys_locale` (the language catalog's locale detection), and `semver`, `ureq`,
105
+ `tar`, `zip`, `flate2` (the self-updater and its npm-archive extraction).
106
+ `ureq`, `tar`, and `flate2` are still used as `[build-dependencies]` by
107
+ `build.rs`.
108
+
109
+ ## If you change a file under `src/`
110
+
111
+ Add the notice Apache-2.0 §4(b) requires, in the file itself, as the very first
112
+ line:
113
+
114
+ ```rust
115
+ // Modified by dsh-ops (https://github.com/T-Auto/dsh-ops): <one line saying what changed and why>.
116
+ ```
117
+
118
+ and record the change in the tables above. The gate does not currently enforce
119
+ this — review does.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ https://www.apache.org/licenses/LICENSE-2.0
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ https://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,40 @@
1
+ FastCtx
2
+ Copyright (c) 2026 yc-duan <dy2958830371@gmail.com>
3
+
4
+ This product is developed and maintained at:
5
+ https://github.com/yc-duan/fastctx
6
+
7
+
8
+ ================================================================
9
+ ATTRIBUTION NOTICE
10
+ ================================================================
11
+
12
+ Section 4(d) of the Apache License 2.0 requires that any Derivative
13
+ Work you distribute carry a readable copy of the notice below, in the
14
+ documentation you ship with it and wherever third-party notices
15
+ normally appear. For a source repository, that place is the README.
16
+
17
+ Reproduce it verbatim:
18
+
19
+ This product includes FastCtx
20
+ (https://github.com/yc-duan/fastctx), Copyright (c) 2026 yc-duan,
21
+ used under the Apache License 2.0.
22
+
23
+ FastCtx is redistributed and/or modified here by the maintainer of
24
+ this distribution. Any such change is that maintainer's own work
25
+ and their sole responsibility. It is not endorsed by, not
26
+ supported by, and not attributable to the author of FastCtx, who
27
+ accepts no liability of any kind arising from this distribution or
28
+ from anything built on top of it.
29
+
30
+ Section 4(b) separately requires that files you modified carry
31
+ prominent notices stating that you changed them.
32
+
33
+
34
+ ================================================================
35
+
36
+ Third-party components bundled with this software are listed in
37
+ THIRD_PARTY_LICENSES.md.
38
+
39
+ If you integrate, redistribute, or build a product on top of this work,
40
+ the author would appreciate hearing from you: dy2958830371@gmail.com