# Changelog All notable changes to `seal-use` will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ## [0.10.26] - 2026-09-15 ### Fixed - **`seal-use update` Installed the Previous Release's Agent Skill**: `update` replaced the binary and then called the in-process skill sync, which writes the `EMBEDDED_SKILL_FILES` compiled into the *running* image — and after `renameSync` the running image is still the release being replaced. Every self-update therefore installed the binary it had just downloaded together with the skill of the version it was leaving. Measured on a real update: binary v0.10.25, `~/.agents/skills/seal-use/SKILL.md` rewritten in the same minute, still reading `version: 0.10.24` and 25 lines behind. The stale copy is not cosmetic — the 0.10.24 skill told agents to use `seal_cli` as the primary MCP path and knew nothing about the `seal_cli` / `seal_cli_write` split, so write commands were refused with no follow-up tool named. Nothing healed it: the only automatic sync is gated on the long-removed `seal-home` legacy directory. `update` now installs the skill by running the **newly installed binary** as one synchronous child process (nothing is left running), then reads `SKILL.md` back and fails loudly when the version is not the version it just installed — the binary stays updated, and the error names `seal-use skill install`. The old failure mode was invisible because "the file was written" was the only thing ever checked. - **`install.sh` Verified the Wrong Line of `checksums.txt`**: `grep "${asset}" | head -n1` is a regex match, and `seal-use-darwin-arm64` also matches the `seal-use-darwin-arm64.tar.gz` line, which `sha256sum seal-use-*` emits first — so verifying an archive compared it against the raw binary's hash. Now an exact `awk '$2 == name'` match against the asset that was actually downloaded. ### Changed - **The Compressed Archive Is Now the Preferred Download**: `seal-use update` and `scripts/install.sh` both fetched the raw executable (67–102 MB) even though a `.tar.gz` (25–39 MB) ships beside it — and the Gitea mirror publishes the darwin-arm64 archive first precisely because it is small, so the raw-binary preference was also the slowest path through the mirror. `matchAssetForPlatform` now prefers the archive on darwin and linux; Windows still prefers the raw `.exe`, because extracting the `.zip` there would rely on an `unzip` binary that stock Windows does not ship. `install.sh` tries the archive across every mirror and falls back to the raw binary when a release or mirror only carries that. - **`install.sh` Accepts `SEAL_USE_INSTALL_DIR`, and Extraction No Longer Needs `find`**: the target directory used to be whichever writable global bin the script found first, which made the installer impossible to exercise without touching a real global bin; it now takes an explicit directory (which is how this change was tested end-to-end against a scratch directory, including the archive-404 fallback). Archive extraction also stopped shelling out to `find`, which Windows does not ship — the archive path could not have worked there even after a successful download. ## [0.10.25] - 2026-09-15 ### Added - **`x-implementation-status` on Every OpenAPI Operation, Gated by a Test**: the published contract and the adapter had drifted in **both** directions, and the CI sync gate only compared `openapi/openapi.yaml` against `dist/openapi.json`, so neither direction was visible. It advertised `/v1/approval/rules/{ruleId}` PATCH/DELETE, `/v1/approval/documents*`, `/v1/corps/current/switch` and `/v1/material-packages/upload` — none of which `src/http/routes.ts` routes, so a caller following the contract got 404 — while omitting `/v1/approval-runs/stats`, `/v1/preferences` and `/v1/preferences/decision`, which it does serve. All 46 operations now carry `implemented` (19) or `planned` (27); the three missing implemented endpoints are documented; and `src/http/openapi-implementation.test.ts` fails when an `implemented` operation has no matching route, when an exact `/v1` route is undocumented, or when either status goes unused. - **Release Guard: the Tag Must Be on `main`**: `release.yml` published on any pushed `v*` tag with `contents: write`, so a tag on an unreviewed branch shipped binaries, and the `workflow_dispatch` tag input could name a tag that was never merged. A guard step now requires the tagged commit to be an ancestor of `origin/main` and fails loudly otherwise (verified against a real release tag, a nonexistent tag, and a branch name). The Gitea mirror job changed from `always()` to "the publish job succeeded", so it no longer chases assets after a refused publish. - **`SECURITY.md`, `CODEOWNERS` and Dependabot**: the trust model was implicit in the code. `SECURITY.md` records how to report privately, which files hold credentials and their modes, and the three documented limitations (the local HTTP adapter does not authenticate; `update`/`install.sh` do not verify signatures; `linters/` is executed code). `.github/dependabot.yml` keeps dependencies and the newly SHA-pinned actions fresh, and `CODEOWNERS` gives branch protection something to require. - **`dist/mcp/server.js` Freshness Gate, Enabled by Pinning Bun**: CI now fails when the committed MCP bundle does not match a fresh build from `src/`, mirroring the `dist/openapi.json` gate. This needed `bun-version` pinned to `1.3.14` in both workflows first — previously `latest`, which resolved to 1.4.2 on the runner, and the minifier allocates identifiers differently across Bun releases, so an unpinned rebuild never matched the committed bytes (measured: identical code, only renamed minified variables). The pin also makes release binaries reproducible and matches the `@types/bun`/`bun-types` already declared in `package.json`. - **CI Boots the Packaged MCP Bundle**: the MCP build step now starts the freshly built `dist/mcp/server.js` and completes a handshake, instead of only checking that it compiles. The artifact is the only thing that ships, so an unbootable bundle is now caught in CI rather than at runtime. This runs *in addition to* the byte-for-byte freshness diff above, which is what the `bun-version` pin exists to keep meaningful; the handshake covers the failure the diff cannot see (a bundle that rebuilds identically but cannot start). ### Fixed - **Credential Files Could Be Group/World-Readable**: the tool writes credentials `0600` (`core/config/loader.ts`, `cli/commands/corps.ts`, `core/auth/token-store.ts`), but `usage.json` used the `0o644` default and hand-placed enterprise configs kept it too — `enterprises/local.json` holds a plaintext Hose app key and password. `usage.json` is now written `0600`, and `seal-use doctor` gained a `credential_permissions` check that lists any credential file wider than `0600` (skipping the `example.*.json` templates) instead of leaving the mode to be discovered by hand. - **`isSealHomeProcess` Matched Substrings Instead of the Daemon**: the pid file proves only that *some* process holds that pid, yet `service stop` accepted any command line containing `seal-use`, `service` and `run` as substrings anywhere — so a stale pid could look like our daemon and get signalled. Identity is now matched as argv tokens: an exact adjacent `service run` pair plus a path to this app root or a `seal-use`/`seal-home` launcher. - **OpenAPI Described the Adapter as Unimplemented, and an Unauthenticated Header as "Optional"**: `info.description` said the contract applied "once the HTTP adapter is implemented" and `servers[0]` called itself "reserved for a future local HTTP adapter; the current service uses MCP stdio" — both false, since `seal-use http` and the `service start` daemon serve it. The `localSession` scheme was documented as an "optional" header that no code reads. The description now states what is served, and the scheme states plainly that requests are not authenticated and the port must stay on loopback. - **Read-Only MCP Refused Three Read-Only `approval-runs` Verbs**: `approval-runs search`, `approval-runs pick` and `approval-runs bridge` were refused by the read-only tool even though each only queries. The #117 note that `pick` had "moved into read-only" was true of the tool registry but not of the CLI allow-list, which is exactly the kind of split-brain the next entry prevents. - **Consistency Test Between the CLI Allow-List and the Tool Registry**: the two read/write classifications are maintained by hand in different files, and they had already disagreed twice (`analytics analyze` allow-listed while its tool POSTs; the three verbs above missing). A test now derives the pairing mechanically — every `action === "x"` in `src/cli/commands/*` that dispatches to a `runTool("seal_…")` — and fails when a CLI verb that reaches a read-only tool is itself refused. It asserts a minimum number of pairs so a change in dispatch shape cannot make it silently vacuous, and names its two exceptions explicitly: the `deploy ` short forms, which `deploy` rejects at runtime, and `approval-runs search`, an accepted alias of `list` with no help-registry row. - **MCP Server Bundle Could Not Start At All**: the plugin shipped `dist/mcp/server.js` as its MCP entry point, but that bundle threw `TypeError: ... is not a constructor` while loading and never answered a single request. Because MCP defaults to off, it failed silently — enabling it produced no `seal_cli` tool and no visible error. - Root cause: the MCP entry (`src/server.ts`) was circularly entangled with the CLI command graph (`server → cli/runner → cli/commands/mcp → server`, and `server → cli/runner → cli/commands/http → http/routes → server`). When `bun build --target=node` flattened that cycle together with zod's own `core ↔ classic` cycle, zod's class initialisers ended up ordered after the top-level `z.lazy()` call the SDK makes at import time, leaving `ZodLazy` undefined at call time. - Fix: moved `tokenizeCommand` / `normalizeCliArgs` into a leaf module (`src/cli/tokenize.ts`) and made the `mcp` command import the server lazily, removing both cycles. The stock build command now emits a working bundle. - Added a regression test that boots the packaged `dist/mcp/server.js` over stdio and completes a handshake. The existing tests exercise source rather than the shipped artifact, which is why this went unnoticed. ### Changed - **`package.json` Can No Longer Be Published by Accident**: it had no `private` flag, no `files` list and none of `description`/`license`/`author`/`repository`, so an `npm publish` would have shipped 212 files including `.github/workflows`, `openapi/`, `docs/proposals`, `src/**/*.test.ts` and `dist/raw-seal-openapi.json` — and the `bin` entries point at `src/cli.ts`, which npm cannot execute, so the published package would have been broken on arrival. `private: true` makes the Release binaries the only distribution channel (the `bin` field stays for `npm link`, which the README recommends for development). Added the missing metadata. - **`packageManager` and `engines` Now Match the Pinned CI Toolchain**: both workflows pin `bun-version: 1.3.14` because the MCP bundle's byte-for-byte freshness gate depends on it, but the repository declared nothing — so a contributor on a different Bun got a bundle that failed the gate for reasons unrelated to their change. `packageManager: "bun@1.3.14"` and `engines.bun` record the same pin, alongside the build instructions. - **Documented Exception for Prose on `stdout`**: `AGENTS.md` required clean JSON on `stdout` without exception, yet `seal-use --help` and `seal-use doctor guide` deliberately write Markdown there — their output *is* the payload callers redirect (`seal-use doctor guide > guide.md`). Rather than break that, the contract now names the allowed document-output commands, keeps `src/probe.ts` out of scope as a developer script, and forbids adding new prose-on-stdout commands. - **Actions Pinned to Commit SHAs**: `actions/checkout`, `oven-sh/setup-bun` and `actions/upload-artifact` were referenced by moving tags (`@v4`, `@v2`) in a workflow that cross-compiles the binaries users install. Both workflows now pin the commit each tag resolved to, with the version in a trailing comment for Dependabot to update. - **`plugin-migration-plan.md` Archived to `docs/proposals/`**: a completed migration plan (status: code and release finished 2026-08-12) was sitting at the repository root next to `README.md` and `AGENTS.md`. - **`linters/` Explains Itself**: the directory is gitignored in full and loaded at runtime from `/linters`, so a fresh clone silently had no custom linters and no way to learn the convention. `linters/README.md` is now tracked (the only tracked file there) and records the resolution order, the module shape, and the trust boundary — these files are imported and executed in the CLI process. - **Read-Only Coverage for `seal-use tool `, and a Misclassification Fixed**: the 98-entry internal tool registry now carries an exhaustive read/write classification (`SEAL_READ_ONLY_TOOLS` / `SEAL_MUTATING_TOOLS` in `src/domains/seal/tools.ts`), so the read-only MCP tool reaches read-only registry tools (66 of them) instead of refusing the whole `tool` area. A test asserts the two sets partition the registry exactly, so a newly added tool fails the suite until it is classified rather than silently defaulting. - This caught a mistake shipped in #115: `analytics analyze` was allow-listed as read-only, but it calls `seal_insight_record_analyze`, which issues a **POST** and starts an analysis server-side. Removed. The classification was cross-checked mechanically — every exported function in `src/domains/seal` that performs a mutating HTTP call was mapped to the tools invoking it — rather than by trusting tool names. - `approval-runs pick` moved the other way, into read-only: it is a query, not a local-state mutation. - **MCP TypeScript SDK v1 to v2**: the monolithic `@modelcontextprotocol/sdk` package has been split into scoped packages. Migrated the server to `@modelcontextprotocol/server` and the tests to `@modelcontextprotocol/client`, both at v2. - Replaced the low-level `Server` + `setRequestHandler` usage with the high-level `McpServer` + `registerTool`, and the hand-written JSON Schema literal with a Zod `z.strictObject` schema (which still emits `additionalProperties: false`). - Added tool metadata clients could not previously see: a `title` and `annotations` (`readOnlyHint: false`, `destructiveHint: true`, `idempotentHint: false`, `openWorldHint: true`). `seal_cli` is a passthrough that can reach mutating verbs, so it must not be advertised as safe to auto-run or safe to retry; the description now names the command families that need user confirmation. - `startServer` uses the v2 `serveStdio` entry point, which owns protocol-era negotiation (2025-era clients keep working) and connection teardown. - `.mcp.json` uses the ZCode-native `${ZCODE_PLUGIN_ROOT}` instead of the Claude-ecosystem alias (verified equivalent in ZCode's resolver). - **Approval Runs Export No Longer Emits `driftCount`** (#112): `approval-runs export` returned a bare audit-drift counter with no way to trace it back to a document — no SN, no `recordId`, no reason — so interpreting it required a separate per-document `approval-runs flow` query. The drift itself is already visible in the workbook's `E人工行为` / `E人工意见` columns (e.g. AI 决策「通过」with E人工行为「已撤回」and a formatted retraction opinion), and `seal_approval_runs_export` never enabled the flow alignment, so the field was a constant `0` there. Removed `driftCount` from the export result rather than enriching it; per-run `auditDrift` / `auditDriftReason` in `approval-runs flow` are unchanged. - **MCP Exposes a Read-Only Tool and a Write Tool Instead of One Passthrough**: `seal_cli` could reach every command, so its annotations had to be all-or-nothing (`destructiveHint: true` on a tool that mostly reads, meaning clients could not auto-approve anything, or nothing could be gated — no middle ground). Split into: - `seal_cli` — read-only, annotated `readOnlyHint: true` / `destructiveHint: false`, so clients may auto-approve it. - `seal_cli_write` — mutations, publishing, credential minting, self-update and server commands, annotated `destructiveHint: true`. - The boundary is **enforced, not just annotated**: `seal_cli` executes only commands on an explicit allow-list (84 read-only entries in `src/cli/read-only.ts`) and fails closed on anything unclassified — including commands added to the CLI later. Matching reuses the CLI's own `parseArgs` and matches whole tokens, so a read prefix cannot smuggle a mutation (`corps listing` is refused) and read prefixes cannot cover subcommands (a bare `doctor` does not cover `doctor `). Refusals name `seal_cli_write` as the follow-up. - Deliberately excluded from the read-only set even though they look harmless: anything writing local config (`corps switch`, `config test-dir`), minting or printing credentials (`auth keys`, `corps extract-keys`), self-updating (`update`), or standing up a long-running server (`http`, `mcp`, `service run`). `seal-use tool ` is also excluded, since the 98-entry internal tool registry is not itself classified. - A test asserts every allow-listed command still exists in the help registry, so the list cannot silently rot. - **MCP Is an Optional Path, Off by Default**: made explicit in the skill. The CLI is the primary channel; a missing `seal_cli*` tool is the normal default rather than a fault, and enabling it is the user's choice in the plugin settings. Also corrected skill docs that presented internal tool-registry names (`seal_webhook_get`, `seal_webhook_update`, …) as if they were MCP tools — the MCP server exposes only the two `seal_cli*` tools, and those registry entries are reached through them. ## [0.10.24] - 2026-09-15 ### Added & Enhanced - **Hose Subdomain Privilege Elevation & Assist Link Key Extraction (`extract-keys` / `add-link --as-hose`)**: - Implemented extracting permanent OpenAPI developer credentials (`appKey` and `appSecurity`) from incoming Hose/Ekuaibao assistance links (`thirdparty.html`) via internal session key interfaces (`GET /api/innerapi/v1/key`). - Added `seal-use corps extract-keys ` (alias: `seal-use auth extract-keys`) with `--reveal` (`-r`) for explicit unmasking and `--save` to upgrade short-lived session links into durable standard Hose enterprise configurations. - Added `--as-hose` option to `seal-use corps add-link` to automatically elevate privileges to standard Hose configuration upon link import. - **Strict Subdomain Hierarchy & Core Domain Boundaries**: - Explicitly defined the Hose capability boundary: `seal-use` is the primary smart approval platform; Hose is an upstream integrated ecosystem. - Calling key extraction or `keys` on native Seal enterprises (`corp.source.type !== "hose"`) is strictly rejected with exit code 2 and explicit subdomain boundary explanations. - **Multi-Key Disambiguation Guardrails**: - Enforced interactive disambiguation when an enterprise has multiple OpenAPI keys configured instead of guessing or silently picking the first key. - Emits candidate key lists with application names, appKeys, keyIds, and active status to `stderr`, requiring explicit selection via `--app-key ` or `--key-id `. Single-key enterprises are safely auto-selected. - **Key Inspection Commands (`corps keys` / `auth keys`)**: - Added `seal-use corps keys [ | ]` and `seal-use auth keys [--corp ]` to safely inspect configured developer credentials with automatic middle-segment masking (`sec_1234...5678`) and optional `--reveal` display. - **同等凭据原则(Equal Credential Scope Principle)— Skill & Documentation**: - Fully documented that a Hose assistance link and a browser cURL from an authenticated Hose admin session are both Hose web frontend sessions with identical privilege scope — the structural difference is delivery format only. - Updated `SKILL.md` First Rules and `enterprise-onboarding.md` Route 3 with explicit guidance: when a Hose administrator provides a browser cURL, attempt privilege elevation first (extract `accesstoken`+`corpid`+`baseUrl` → call `/api/innerapi/v1/key`), not a downgraded short-term session import. - Added Route 3a/3b/3c classification in `enterprise-onboarding.md` and a privilege comparison table (F12 session vs. elevated OpenAPI credentials). ## [0.10.23] - 2026-09-15 ### Added & Enhanced - **Hose Native Approval Flow Alignment (`--with-flow`)**: - Added opt-in `--with-flow` flag to `seal-use approval-runs export` to enrich reports with **E人工行为** and **E人工意见** columns from native Hose/Ekuaibao approval timelines. - **Rejection Formatting (样式 2-B 三行展开式)**: Cleanly structures rejections with explicit reject target nodes, staff names with roles, and resubmission routing (`↳ 驳回至: ...` / `↳ 重新提交后由...继续审批`). - **Mid-Flow Modification Detection**: Identifies mid-flow edits (`已支付 (中途修改)` / `审批通过 (中途修改)`), hoists modification events to top (`✏️: 修改了单据`) for instant fact visibility while strictly preserving genuine approval-flow chronological sequence numbers. - **Action Emojis**: Visual distinction across approval actions (`✏️` 修改、`🤖` 自动同意、`❌` 驳回、`💰` 支付、`💬` 附言、`↩️` 撤回、`🔀` 转审),while normal approvals maintain a clean text format (`: 同意`). - **Targeted Document SN Export Filter (`--sn` / `--sns`)**: - Supported `--sn ` or `--sns` option for `seal-use approval-runs export` to filter specific documents by single or comma-separated document SNs. - Direct indexed lookup via Seal backend `search: sn`, bypassing full pagination scans and reducing export runtimes from 30+ seconds to ~1.5 seconds. - Smart time windowing: searches across full history without artificial 1-day truncation when start/end dates are omitted, and dynamically computes filename date interval from retrieved records. - **Strict Clean Export Filenames with Forced Minute Timestamp**: - Enforced a standard format `${safeCorpName}_审核记录_${dateTag}_${countTag}_${YYYYMMDD_HHmm}.xlsx`. - Filename timestamp suffix accurate to the minute prevents accidental overwrites and ambiguity. - Eradicated document SN numbers from the output filename to maintain a concise, standard pattern regardless of export batch size. - **CLI Help, Guidance & Diagnostics Channel**: - Enhanced `seal-use approval-runs export --help` with complete option table. - Added next-step command suggestions (`👉 查看导出文件: open "..."`) and flow enrichment hints to `stderr`. - Synchronized `skills/seal-use/SKILL.md` and CLI documentation references. ## [0.10.22] - 2026-09-14 ### Added & Enhanced - **Webhook Resource Pack Export & Dataset Renaming**: - Formally renamed the Webhook dataset format to **Webhook 资源包** (Webhook Resource Pack, CLI: `resource-pack`, alias: `pack`), cleanly distinguishing it from Seal backend's native simulation material pack while keeping `material-pack` 100% backward-compatible. - Implemented `exportApprovalRunsToResourcePack` and CLI command `seal-use webhook resource-pack export` to export online approval runs and downloaded attachments into a local standard `.zip` resource pack for offline distribution via third-party channels. - Refined bidirectional ZIP validation so documents without attachments do not trigger false directory-missing errors. - **Official HLab Structured Rule Linter (`hlab`)**: - Implemented the official HLab Rule Linter (`hlab`, aliases: `hlab-sop`, `hlab-rules`, `hlab-standard`) based on industrial Rule-as-SOP standards. - Enforces check methods (`**检查方法**`), evaluation standards (`**判定标准**`), ternary decision closure (`- PASS`, `- FAIL`, `- 证据不足` with manual review), disposal action decoupling, and false-skip prevention. - Automatically synchronizes plaintext template to `~/.config/seal-use/linters/official/hlab.ts`. ## [0.10.21] - 2026-09-14 ### Added & Enhanced - **Standardized Export Date Range & Filename Contract**: - Unified all Excel export filenames (`approval-runs export` and `analytics export`) into a strict closed interval format `${safeCorpName}_..._${startDate}至${endDate}...`. - Completely eradicated open-ended naming phrases (`至今` and `截至`), guaranteeing 100% deterministic and parseable filenames across the CLI and MCP tools. - **Smart Date Boundary Defaults & Stderr Notifications**: - Implemented intuitive interval fallbacks when date boundaries are omitted: - Omitted both: defaults to yesterday through today (`yesterday至today`). - Omitted end date: defaults to today (`startDate至today`). - Omitted start date: defaults to 30 days prior to end date (`endDate - 30d至endDate`). - Emits explicit interval fallback declarations to `stderr` (`ℹ️ 未指定导出起止时间...`) while keeping `stdout` strictly machine-parseable JSON. - **180-Day Safety Guardrail & `--force` Flag**: - Added an automatic 180-day (~6 months) span guardrail for both approval run audit logs and smart insights risk exports. - Export requests exceeding 180 days are cleanly intercepted with non-zero exit code and diagnostic guidance unless `--force` is explicitly provided. - Emits a prominent warning to `stderr` when `--force` is applied to massive exports. - **Approval Runs Count Time Filtering**: - Extended `seal-use approval-runs count` to support `--start ` and `--end ` options for bounded quantity counts without requiring full record retrieval. ## [0.10.20] - 2026-09-13 ### Added & Enhanced - **Tenant Contract Doctor Probe (`seal-use doctor tenant`)**: - Implemented 100% deterministic tenant contract probe `seal-use doctor tenant [--corp ] [--quiet]` with structured JSON on `stdout` and terminal diagnostic dashboard on `stderr`. - Probes 5 critical tenant contracts: identity & admin roles (`getMe`), AI approval billing quota & point deductions (`getBillingStatus` balance, deductionAmount, estimated runs), active rules & unreleased draft safety (`listApprovalRules`), webhook integration readiness, and test environment pairing. - **Automated Rule Regression Test Matrix (`seal-use test regression`)**: - Added `seal-use test regression` (alias: `seal-use corps regression`) to run automated regression testing across paired production and test environments. - Enforced Hard Red Line 1: strictly prohibits running directly against pure production enterprises; target MUST be a paired test enterprise (`environment: "test"`). - Enforced Hard Red Line 2: pre-flight checks AI approval balance (`balance >= samples * deductionAmount`), blocking immediately if points are insufficient. - Implemented outbound HTTPS polling for test run completion, eliminating any inbound port or public IP requirement in NAT/VPN corporate networks. - Compares production vs. test decisions (`APPROVE`, `REJECT`, `MANUAL`, `ERROR`), detects decision flips, computes concordance rate, determines `safeToPublish`, and supports `--dry-run` and `--fail-on-flips` for CI/CD safety gates. - **7-Day Enterprise Usage Tracking & List Optimization (`seal-use corps list`)**: - Added enterprise usage tracker (`src/core/stats/usage-tracker.ts`) recording 7-day call frequencies and recency. - `seal-use corps list` defaults to displaying the top 10 most frequently used enterprises in the last 7 days to prevent list dump spam for large enterprise catalogs. - Supported `--all` to display the entire enterprise list, and `--sort ` to customize ordering. - **Skill & Guidance Modernization**: - Synchronized `skills/seal-use/SKILL.md` and reference documentation with `doctor tenant`, `test regression`, and usage ranking. ## [0.10.19] - 2026-09-13 ### Added & Enhanced - **Smart Insights Full Suite & Multi-Sheet Excel Export**: - Implemented complete Smart Insights analytics suite: `seal-use analytics risks` (risk tag frequency and interception trends), `seal-use analytics performance` (Sankey review throughput, adoption rates, avg duration), `seal-use analytics analyze` (on-demand rule/document risk diagnosis), and `seal-use analytics insight` (overview metrics). - Added multi-sheet Excel export CLI `seal-use analytics export` (aliases: `report`, `download`) and MCP tool `seal_insight_export`. Generates styled `.xlsx` reports with 3 dedicated sheets (`审核效能与决策流向`, `Top 风险标签分析`, `风险单据穿透明细`), supporting `--downloads` to system downloads directory and custom `--out` paths. - **Rule Linter Directory Restructuring & Official Isolation**: - Structured `~/.config/seal-use/linters/` for custom user linters while isolating official linters in `~/.config/seal-use/linters/official/`. - Added plaintext sync mechanism (`syncOfficialLinters`): writes human- and Agent-readable TypeScript source files (`builtin.ts` and `strict.ts`) with types and JSDoc, overwrites user modifications unconditionally, and prunes rogue files in `official/`. - Added `strict.ts` linter: enforces quantitative boundaries (amounts, days, strict limits), catches vague expressions, errors on hanging exceptions without required notes/attachments, and enforces concrete approver roles. - Added CLI `seal-use rules linters` to inspect available linters and updated `seal-use doctor paths` with `officialLintersDir`. - **Unified Seal Backend HTTP Client & Enterprise Context Injection**: - Enhanced `createSealClientForUrl` in `src/core/http/factory.ts` with optional Bearer token support, allowing pre-auth endpoints (SSO exchange, OAuth2 session, whoami) to use the unified client without sending invalid Authorization headers. - Unified all outbound Seal backend HTTP calls across `auth.ts`, `corps.ts`, `hose.ts`, `api.ts`, `webhook-replay.ts`, and `material-pack/service.ts`, ensuring enterprise custom headers (`corp.seal.headers`) and gateway cookies (`corp.seal.cookies`) are consistently injected. - **Test Enterprise Webhook Replay & Auto-Pairing**: - Added `seal-use corps replay-test ` and `seal-use webhook replay` for dry-run and live event replay against bound test enterprises. - Automatically sanitizes payloads, strips incompatible reference structures, and enforces test target safeguards (`--force` required for non-test targets). ## [0.10.18] - 2026-09-11 ### Added & Enhanced - **System Diagnostic Doctor & Embedded Specification Whitepaper**: - Added `seal-use doctor` for unified system health diagnostics, inspecting executable runtime, 8 core filesystem paths, enterprise assets, and health checks. - Implemented `seal-use doctor guide` to output the full system architecture, 10-tier directory specifications, security guarantees, and capability matrix directly from binary memory with zero additional disk writes. - Added `seal-use doctor paths` for compact JSON inspection of core directory status and descriptions. - Adheres strictly to dual-channel protocol: typed JSON on `stdout` and terminal diagnostic dashboard on `stderr`. - **Intelligent Soft Fuzzy Search for Enterprise Discovery**: - Introduced dedicated fuzzy engine (`src/core/search/fuzzy.ts`) supporting case-insensitivity, Chinese homophones/allophones, pinyin initials (简拼), full pinyin, nasal/retroflex normalization, and Levenshtein typo tolerance. - Enabled soft fuzzy search by default on `seal-use corps search ` and `seal-use corps list`, with `--strict` option for exact substring matching. - Enforced `corps search` in Agent Skill guidelines over dumping entire enterprise lists when names or hints are known. - **Dedicated Enterprise Lookup & Compatibility Alias**: - Added `seal-use corps get ` to inspect a single enterprise by ID, exact name, or unique prefix. - Added `corp` as a first-class CLI compatibility alias for `corps` across command dispatching and help registry. - **Approval Run Deep Link & SSO URL Generation**: - Added `seal-use runs url [--sso] [--corp ]` to generate direct Web UI links and security-guarded SSO links for approval runs. - **Approval Run to Webhook Replay**: - Added `seal-use runs replay [--corp ] [--target ]` to reconstruct webhook payloads from historical runs for deterministic regression testing. ## [0.10.17] - 2026-09-11 ### Added & Enhanced - **Automatic Hosecloud Integration Synchronization for Staging Test**: - `seal-use corps sync-test` automatically syncs Hosecloud (合思) integrations from production to bound test Seal enterprises. - Generates standardized outbound name `{企业名前缀}(Seal测)` capped at 13 characters to satisfy platform limits. - Automatically overrides mode to `assisted` in test environments regardless of production mode. - Reuses production `apiOrigin` and `customApiUrl`, while extracting credentials directly from local enterprise source config (`appKey`/`appSecurity` with `key`/`password` fallback). - Automatically deduplicates multiple production integrations belonging to the same enterprise into a single test integration. - Retains existing `signKey` when updating for idempotency; skips outbound sync to Hosecloud to guarantee zero impact on production approval workflows. - Added `hosecloudSyncPlan` to `--dry-run` output and `hosecloudSync` result to execution summary. - **Comprehensive Staging Simulation & Production Rule Evolution Guide**: - Added `skills/seal-use/references/staging-simulation-workflow.md` covering enterprise pairing, auto-sync, staging simulation validation, and production rule rollout. - Enhanced `skills/seal-use/SKILL.md` with version verification mandates, self-update instructions (`seal-use update`), and staging-first safety guidelines. - **Complete Dispatchable Area CLI Help Coverage**: - Registered missing `service` and `stop` help entries, aliased `server` to `mcp` help, and resolved `config status` aliases. - Dynamically generated global help from `HELP_REGISTRY`, eliminating drift and redundant usage blocks. - Only emit subcommand footers for areas that have subcommands. - Added automated coverage tests across all `KNOWN_AREAS`. - **Skill Documentation & Routing Expansion**: - Updated `SKILL.md` and `references/cli.md` covering read-only discovery, rule workspace, analytics/export, async simulation, and knowledge document lifecycle capabilities. ## [0.10.16] - 2026-09-11 ### Added & Enhanced - **Full-Coverage Knowledge Document Synchronization**: - Extended `seal-use corps sync-test` to synchronize knowledge articles (`api/v1/knowledge/articles`) alongside rules and preferences. - Natural key matching by title: creates missing documents, updates changed documents, and physically deletes redundant test documents (`DELETE /api/v1/knowledge/articles/:id`) to prevent stale background knowledge from distorting audit simulation. - Safe scenario fallback: automatically defaults empty `scenarios` to `["audit"]`, preventing backend 400 validation failures. - Added `deleteApprovalDocument` in Seal API, exported `seal_approval_delete_document` in MCP tools, and updated OpenAPI schema. - Added `documentsPlan` to `--dry-run` output and structured `documents` execution summary. - **Semantic Sync Versioning with Target Test Version Visibility**: - Enhanced published version name format to `Sync from [Prod v · # -> Test v]`. - Solves the Seal Web UI limitation where custom version names omit the assigned test version number. - Backward-compatible regex parsing in `computeNextSyncIteration` handles legacy un-numbered, bracketed, and arrow-mapped formats. - **Cross-Tenant Rule Mapping & Inspection**: - Tracks bidirectional rule relationships (`versionMapping` and `ruleMapping`) between production source IDs/Codes and test target Codes/IDs. - Automatically saves lightweight mapping snapshots to `~/.config/seal-use/mappings/-v.json`. - Added `seal-use rules map [--corp ] [--code ]` command for easy querying and filtering of mapped rule origins. - **Approval Style Preferences HTTP Method Alignment**: - Aligned approval style preferences endpoint updates to use `POST` (`api/v1/agent/ai-approval/config`) matching Seal backend contract. - **Local Dev Binary Override & Git-Aware Versioning**: - Added `bun run dev:override` to compile host binaries with Git dev version metadata, macOS code sign, atomically override `/opt/homebrew/bin/seal-use`, and sync agent skills. - CLI version output reports active channel (`dev` vs `release`), commits ahead, dirty state, and commit hash. ## [0.10.15] - 2026-09-11 ### Added & Enhanced - **Contextual & Subcommand-Scoped CLI Help System**: - Implemented structured help registry in `src/cli/help.ts` supporting hierarchical command lookups. - Subcommands (e.g. `seal-use corps bind-test --help`) now show only targeted usage, options, and descriptions instead of dumping all 120+ top-level commands across unrelated domains. - Domains (e.g. `seal-use corps --help`) now show only relevant domain commands. - Eliminates context window pollution for AI agent harnesses and human operators while preserving backwards-compatible global `help`. - **Production to Test Enterprise Association & Staging Rule Sync**: - Added `seal-use corps bind-test [--confirm] [--force]` establishing a strict 1-to-1 association. - Added anti-chaining validation preventing test enterprises from being nested or looped as production parents. - Added `seal-use corps sync-test [] [--dry-run] [--yes] [--version-name ]` to synchronize production draft rules and decision preferences to the bound test enterprise. - Automatically publishes a new rule version on the test enterprise while guaranteeing production rules remain safely in draft state. - Added `seal-use corps unbind-test [] [--confirm]` and `corps mark --env [--confirm]`. - **Configuration Directory Normalization & Migration**: - Automatically syncs legacy enterprise configs (`~/.config/seal-home/enterprises`) into primary directory (`~/.config/seal-use/enterprises`). - Restricts runtime enterprise loading strictly to the primary directory once present, preventing stale legacy reads. - Safely deletes the legacy directory when all files are synchronized and unmodified for more than 7 days. - **Release Pipeline & Exit Code Standardization**: - Fixed Gitea release asset fallback when artifact quota is full. - Standardized unknown command and subcommand error classifications to exit code 2. ## [0.10.14] - 2026-09-11 ### Added - **Material Pack Webhook Attachment File Policy**: - Added per-Webhook minimum file size (default 500 bytes), optional maximum file size, and configurable file-extension whitelist. - Added unified configuration fields for creating and updating Webhook policies. - Enforced the policy before attachment upload and document push, with detailed validation errors and no partial push on failure. - Added default support for common PDF, Office, text, email, and image formats. - **Unified CLI coverage for staging frontend capabilities**: - Added read-only contacts queries for department trees, department details, department users, and last synchronization time. - Added `analytics insight` for risk-tag statistics with date-range filtering and current-month defaults. - Added paginated `data expenses` and `data invoices` queries with frontend-compatible filters. - Added `simulation approval-definitions` to discover Feishu approval codes before creating a test batch. ### Fixed & Enhanced - Added non-blocking simulation status checks and `simulation create --no-wait`. - Added semantic CLI exit codes and actionable next-command guidance. - Added universal `--dry-run` previews for supported configuration and destructive operations. - Changed approval-rule pushes to apply incrementally while preserving existing rule IDs. - Preserved HTTP error response bodies for actionable upstream diagnostics. - Documented draft versus published rule code spaces and knowledge-document creation constraints. ## [0.10.13] - 2026-09-08 ### Fixed & Enhanced - **Material Pack Scope Isolation & Strict Path Uniqueness**: - Enforced per-document directory scope isolation: all attachments declared for a document must strictly reside in its own folder (`/` or `@annotation/`), preventing cross-document file borrowing or path confusion. - Enforced global declaration uniqueness: identical attachment file paths can no longer be declared more than once across the entire material pack (even within the same document or different line-items). Multiple uses require placing distinct physical files in independent paths. - Added comprehensive unit tests covering cross-document directory violations, intra-document duplicate paths, and multi-document path collisions. - Updated documentation in `cli.md` detailing the strict scope isolation and declaration uniqueness rules. ## [0.10.12] - 2026-09-07 ### Added & Refactored - **Material Pack Pure Path Declaration & Validation Refactor**: - Replaced ambiguous filename heuristics with explicit `[附件]` Excel column headers and full ZIP-relative file paths. - Added `@` annotation suffix support for ZIP root directories (`@annotation/`) to bypass document idempotency blocks safely. - Enforced bidirectional validation between Excel declarations and ZIP entries without fail-fast, collecting all errors together. - Added automatic key collision deduplication with numeric suffixes (`-2`, `-3`). ## [0.10.11] - 2026-09-07 ### Added & Enhanced - **Standard Approval Runs Excel Export**: - Added `seal-use approval-runs export` command to export tenant approval records into high-fidelity Excel workbooks with frozen headers, dynamic rule columns, and color-coded status badges. - Automatically resolves document template names, manual approval statuses (`APPROVED`, `TERMINATED`, `PROCESSING`), and human reviewer reject comments from `manualApprovalRecord`. - Dynamically fetches tenant active approval rules (`api.listApprovalRules`) and appends rule check results (`PASS`, `FAIL`, `TRIGGERED`) as individual column badges. - Added `--downloads` flag to conveniently output directly to the user's `~/Downloads` folder. - Added `seal_approval_runs_export` tool in MCP/agent tools for automated reporting and data inspection. - Supports `--start`, `--end`, `--limit`, `--status`, `--manual-status`, and `--completed-only` filters with gentle pagination and progress reporting to `stderr`. ## [0.10.10] - 2026-09-07 ### Changed & Fixed - **Enterprise Config Resolution Isolation**: - Removed default loading of `./enterprises` from the current working directory (`cwd`), ensuring local repo files never unintentionally leak or override user enterprise configs. - Candidate enterprise directories now strictly default to user global configuration directories (`~/.config/seal-use/enterprises`, `~/.config/seal-home/enterprises`) unless an explicit environment variable or test directory is configured. - **Global Test Enterprises Directory Configuration**: - Added `testEnterprisesDir` field to `GlobalConfigSchema`. - Added `seal-use config test-dir [|--clear]` command to safely configure or clear a dedicated test enterprise directory without impacting normal user operations. - Included `testEnterprisesDir` in global configuration summaries and candidate directory listings. ## [0.10.9] - 2026-09-04 ### Refactored & Purged - **MCP Legacy Code Purge & Strict CLI-First Architecture**: - Removed obsolete intermediate MCP definitions (`sealMcpTools`, `mcpDirectToolNames`, `sealActionNames`, `sealActionAliases`, `runSealAction`, `sealActionHelp`, `findSealMcpTool`) from `src/domains/seal/tools.ts`. - Removed mistakenly registered `seal_approval_run_attachments_download` tool definition and aliases from `tools.ts`. - Decoupled `seal-use approval-runs attachments` (inspection & download) CLI commands to invoke pure domain functions in `src/domains/seal/attachments.ts` directly, bypassing the legacy tool runner. - Purged obsolete "Fine-Grained Tools" lists from `README.md` and `skills/seal-use/references/cli.md`, reinforcing the CLI-First contract where agents execute `seal-use ` directly or via the single `seal_cli` MCP tool. - **Repository-Wide Dead Code & Unused Export Cleanup**: - Eliminated duplicate enterprise directory export aliases in `src/core/config/loader.ts`. - Converted internal helpers in `src/core/embedded-skill.ts`, `src/cli/printer.ts`, `src/cli/commands/auth.ts`, `src/domains/seal/linter/loader.ts`, `src/domains/seal/material-pack/validate.ts`, and `src/core/auth/seal.ts` to private module functions. ## [0.10.8] - 2026-09-04 ### Added & Enhanced - **Approval Run Attachments Extraction Compatibility (Issue #35)**: - Generalized `extractApprovalRunAttachments` to inspect `document.fields[].type === "ATTACHMENT"` arrays with nested `value[]` collections, properly recognizing HoseCloud/Seal 2026 flattened attachment fields that previously resolved to `count: 0`. - Extracted comprehensive metadata including `ossSignedUrl`, `token` (automatically parsing embedded `fileId` and object `key`), `ossFileSize`, `mimeType`, and preserved parent field labels as `sourceField`. - Added `hasSignedUrl` and `ossFileSize` to compact summary outputs without exposing raw signed URLs. - **New Attachments Download Command (Issue #35)**: - Added `seal-use approval-runs attachments download [--name ] [--all] [--out-dir ]` CLI command. - Prioritizes direct `ossSignedUrl` links from the run record and verifies downloaded file size against `ossFileSize`. - Automatically sanitizes sensitive temporary signatures in CLI logging (`?[MASKED]`) to prevent credential leakage in build/agent transcripts. - Implemented graceful error recovery for expired temporary URLs (HTTP 403) or missing links, reporting diagnostics for failed items while allowing valid attachments to complete without interruption. ## [0.10.7] - 2026-09-04 ### Added & Enhanced - **Local Approval Rules Workspace & Offline Linting**: - Added `seal-use rules pull` (`seal_approval_rules_pull`) to export remote draft or published version rules to a local JSON file (defaults to `./rules.local.json`), eliminating unwanted mutations to remote drafts. - Added `seal-use rules lint --file ` to execute rule quality and execution checks completely offline with zero network requests and zero dirty version records in the remote backend. Supports quality score gates (`--min-score`) and operates seamlessly even without configured enterprise credentials. - Added `seal-use rules push` (`seal_approval_rules_push`) to apply refined local rules to the remote draft with preview (`--dry-run`), confirmation (`--yes`), and optional single-step formal release publishing (`--publish`). - **Persistent HTTP Companion Daemon in Background Service**: - Embedded the HTTP API server into `seal-use service run`, allowing `seal-use service start` to run as a detached background daemon with persistent HTTP service (serving `/docs`, `/openapi.json`, and `POST /api/cli`). - Added `seal-use service logs` (`--lines `) to easily inspect service background activity. - Enhanced `seal-use service status` to track active host, port, and URL via daemon metadata state. - Optimized `parseJsonBody` and CLI runner concurrency with standing command bypasses to prevent process queue blocks. - Added top-level `seal-use stop` command, intuitive service aliases (`seal-use service kill|down|shutdown`), and `POST /shutdown` HTTP endpoint to gracefully terminate the background daemon from any terminal or script. ## [0.10.6] - 2026-09-03 ### Added & Enhanced - **Inbound Webhook Material Pack Import (Issue #27)**: Added local preview and push workflows for SealAI material packs, including strict ZIP/XLSX validation, normalized approval-document parsing, attachment upload, and HMAC-signed Webhook delivery. - **CLI and MCP Support**: Added `seal-use webhook material-pack preview|push` and the `seal_webhook_material_pack` tool, while keeping the existing simulation `material_pack` flow separate. - **Test-Enterprise Verification**: Verified the new push path against the configured test enterprise with official sample materials; customer enterprise data was not used. ## [0.10.5] - 2026-09-03 ### Added & Enhanced - **Intelligent HoseCloud Sync Discovery & Actionable Guidance (Issue #26)**: In `seal-use deploy hosecloud sync` and `deploy hosecloud get`, when `` is omitted, the CLI dynamically discovers all active HoseCloud integration configs for the tenant and renders structured cards on `stderr` with 1-click copy commands (e.g. `👉 同步命令: seal-use deploy hosecloud sync --corp `). - **Single-Config Fast Track (`--auto`)**: Added `--auto` (and `--yes`) flag to `deploy hosecloud sync`. When a tenant has exactly one configured HoseCloud integration, `--auto` automatically locks and syncs without requiring manual `signKey` extraction. - **Enhanced Empty State & Diagnostic Hints**: If a tenant has zero HoseCloud integrations configured, clearly prompts the user with next-step configuration command `seal-use deploy hosecloud configure ...`. - **Updated Reference Documentation**: Updated `skills/seal-use/references/hose-enterprise-deploy.md` and CLI references with `--auto` and dynamic discovery patterns. ## [0.10.4] - 2026-09-03 ### Added & Enhanced - **Built-in Approval Rule Linter & Quality Validation Engine**: Introduced a pure TypeScript/heuristic rule quality validator (`seal-use rules lint` & `seal_approval_rules_lint`). Detects subjective fuzzy words (`原则上`, `尽量`, `适当`, `酌情`), hanging exception clauses lacking evidence keywords (`除非/特殊情况` 未指明 `备注/附件/截图` 凭证来源), and short invalid descriptions. - **Plugin-as-Code Dynamic TS Linter Loader**: Supports loading custom enterprise TypeScript linter plugins dynamically from `~/.config/seal-use/linters/*.ts` or explicit paths (`--linter `). - **Fault-Tolerant Automatic Fallback (Anti-Crash Guarantee)**: If a user's custom `.ts` linter file contains syntax errors, throws runtime exceptions, or is missing, the engine automatically catches errors, logs diagnostic warnings to `stderr`, and seamlessly falls back to the built-in heuristic linter without failing or blocking CLI execution. - **Global Config & Default-Disabled Policy**: Added `lint: { enabled: false, activeLinter: "builtin", minScore: 0 }` to global configuration (`~/.config/seal-use/config.json`). Linter is **disabled by default** to avoid unsolicited noise; can be enabled via `seal-use config lint enable`. - **Real-time Diagnostic Hook on Rule Updates**: When linting is enabled, `seal_approval_rule_update` automatically inspects modified descriptions and outputs structured warnings on `stderr` while keeping clean machine JSON on `stdout`. - **Comprehensive Scenarios & Gatekeeping**: `seal-use rules lint` supports full draft scanning, historical version review (`--version `), rule filtering (`--code `), summary mode (`--summary`), and quality gate scoring (`--min-score `) with non-zero exit codes. - **Dedicated Reference Documentation**: Added `skills/seal-use/references/rule-lint.md` and updated SKILL router. ## [0.10.3] - 2026-09-02 ### Added & Enhanced - **Auto Platform Probing for HoseCloud Deployment**: In `deploy hosecloud configure` (`seal_deploy_hosecloud_configure`), automatically probes 6 standard Hose SaaS platform domains (Standard, DingTalk, WeChat Work, Feishu, CloudHub, DingTalk Enterprise) using `probeHoseDomain` when `customApiUrl` is omitted. Eliminates manual platform guessing and prevents authentication failures (`请检查 API 平台和凭证配置是否正确`). - **Standardized Business Terminology**: Aligned all CLI and tool descriptions with Seal AI product semantics: `Seal AI 智能审核发布到合思费控` (replacing raw backend jargon like "合思出站消息"). - **Dedicated Reference Documentation**: Added `skills/seal-use/references/hose-enterprise-deploy.md` covering end-to-end deployment, auto platform detection, 3-step publishing, and EBot node integration. ## [0.10.2] - 2026-09-02 ### Added & Enhanced - **Agent Skill Self-Bootstrap & Auto-Installation**: Embedded direct 1-line installation scripts into `skills/seal-use/SKILL.md` and onboarding references. Third-party AI Agents can now automatically self-install and bootstrap `seal-use` when missing without human intervention. - **CI / Mirror Routing Isolation**: Added intelligent mirror mode resolver (`SEAL_USE_MIRROR=github|gitea|auto`). Automatically bypasses Gitea in CI environments to ensure 100% offline, deterministic, and fast (<20s) test execution. ## [0.10.1] - 2026-09-02 ### Changed & Infrastructure - **Default Branch Modernization (`master` $\rightarrow$ `main`)**: Standardized default branch to `main` across GitHub and Gitea with dual-branch transition compatibility for legacy script URLs. - **Repository Rename (`seal-home` $\rightarrow$ `seal-use`)**: Updated primary repository references to `yunyingk/seal-use` and `gitea/seal-use` with multi-source fallback and GitHub 301/302 redirect support. - **Two-Job Decoupled Release Architecture**: Split CI/CD release workflow into independent GitHub Release job (~40s fast path) and asynchronous Gitea mirror sync job. - **Tiered Gitea Sync with Supreme Priority**: Prioritized `seal-use-darwin-arm64.tar.gz` and `checksums.txt` (Tier 1, ~26MB) for 10-second sync completion on macOS Apple Silicon. ## [0.10.0] - 2026-09-02 ### Added & Changed - **Rebrand to `seal-use`**: Aligned naming mental model with `hose-use` for a unified developer and Agent CLI/SDK ecosystem. - **Clean Agent Skill Cutover**: Replaced `skills/seal-home` with `skills/seal-use` and `.agents/skills/seal-use`. Embedded installer and runtime automatically clean up legacy `~/.agents/skills/seal-home` to eliminate model prompt pollution and routing collisions. - **Dual CLI Binary & Alias Compatibility**: `package.json` exposes both `seal-use` and `seal-home`. Binaries, installer, and self-updater maintain symlinks for 100% backward compatibility with existing terminal habits. - **Cascading Configuration & Token Fallback**: Primary storage in `~/.config/seal-use/` with seamless fallback and lazy migration from legacy `~/.config/seal-home/`. Environment variables support `SEAL_USE_*` with `SEAL_HOME_*` fallback. - **Runtime Self-Healing Bootstrap**: Added zero-overhead runtime self-healing that automatically repairs missing `seal-use` binaries and upgrades global skills when older `<= 0.9.8` installations update. - **Installer Modernization**: Updated `scripts/install.sh` to download `seal-use` assets, create alias symlinks, and clean legacy skills. ## [0.9.8] - 2026-09-02 ### Added - **Hose Assistance-Link Onboarding**: Added `seal-home corps add-link ` to parse supported `thirdparty.html` links, exchange the temporary Hose token through Seal SSO, verify the tenant identity, and write a short-lived enterprise config. - **Direct Delegation Link Generation**: Added `seal-home delegation create --from-link ` to generate a Seal delegation link without first persisting an enterprise config. - **Credential Safety Checks**: Restricted incoming links to HTTPS Hose domains, redacted temporary credentials from CLI output, rejected tenant mismatches, and added focused parser, exchange, onboarding, and delegation tests. ## [0.9.7] - 2026-09-01 ### Enhanced - **Agent-first Enterprise Onboarding**: Added a dedicated first-run workflow that makes Agents discover configured enterprises before asking users for parameters, resolves human enterprise names to internal IDs, and avoids asking users for discoverable `corpId`, `staffId`, or tenant identifiers. - **Identity and Credential Classification**: Clearly separated Hose/合思-sourced versus Seal-native tenant identity from the way access was obtained: standard Hose app credentials, incoming assistance links, or browser-copied cURL sessions. - **Browser cURL Guidance and Secret Handling**: Added concrete F12/Network/Fetch-XHR capture instructions, read-only verification guidance, credential redaction rules, and explicit boundaries for raw cURL and assistance-link capabilities not yet supported by the CLI. - **Simplified Hose Setup Routing**: Updated the standard Hose path to request only `appKey` and `appSecurity` initially, while automatically discovering the domain, enterprise, and administrator candidates. --- ## [0.9.6] - 2026-08-27 ### Fixed & Enhanced - **Smart Download Speed & Stall Monitor**: Added dynamic transfer speed monitoring with a 50 KB/s low-speed threshold and 5s stall detection in `seal-home update`, allowing fast downloads to complete without artificial timeouts while proactively abandoning crawling mirrors. - **Deduplicated Progress Logging**: Eliminated duplicated stderr/console progress logging in binary downloads. - **Curated Mirror List**: Pruned expired/broken CDN mirrors from the fallback candidate chain. --- ## [0.9.5] - 2026-08-27 ### Enhanced & Optimized - **CI/CD Pipeline Security & Least Privilege**: Updated GitHub Actions CI to strictly enforce `permissions: contents: read` and automatic concurrency cancellation (`concurrency.cancel-in-progress: true`), preventing workflow backlogs and privilege escalation. - **CI Build Integrity & Artifact Drift Validation**: Added automated OpenAPI bundling, MCP plugin build, and standalone binary build steps in CI, ensuring `dist/openapi.json` and `dist/mcp/server.js` stay perfectly in sync with source definitions (`git diff --exit-code`). - **Parallel Multi-Platform Cross-Compilation**: Refactored `scripts/build-binary.mjs` to compile all 5 target platform binaries concurrently via `Promise.all`, reducing full build time by 60%+. - **Binary & Plugin Minification**: Enabled `--minify` across standalone binary and MCP plugin builds, reducing plugin bundle size from 1.32MB down to 0.75MB and optimizing binary startup latency. - **Automated SHA-256 Checksums Generation**: Integrated automated `checksums.txt` generation in release pipelines, allowing secure verification of binary integrity upon download. - **Enhanced Installer (`install.sh`)**: Added support for `SEAL_HOME_VERSION` custom version targeting and automated SHA-256 integrity verification. - **Repository Hygiene & Community Standards**: Added standard MIT `LICENSE`, `.editorconfig`, GitHub Issue Forms (`bug_report.yml`, `feature_request.yml`, `config.yml`), Pull Request template, and status badges. --- ## [0.9.4] - 2026-08-26 ### Fixed & Enhanced - **Seamless Release Mirror Fallback & Fail-Safe Routing**: Enhanced `seal-home update` release discovery and asset downloading to automatically fall through to fast CDN and GitHub direct mirrors if a primary mirror returns an incomplete/empty asset list or times out, preventing update failures during in-progress release publishing. - **Unconditional Global Skill Synchronization**: Ensured `seal-home update` and `skill install` always overwrite and synchronize all latest embedded skill files (including `SKILL.md` and all references) to `~/.agents/skills/seal-home/`. - **Parallel Gitea Asset Release Upload**: Optimized CI release workflow to upload release binaries in parallel, reducing publishing latency from 6+ minutes down to ~30 seconds. --- ## [0.9.3] - 2026-08-26 ### Added - **Automated Hose Enterprise Initialization & Probing**: Added `seal-home corps probe-hose` to probe enterprise metadata and discover available role definition groups via OpenAPI. - **Multi-Domain Concurrent Probing**: Intelligently probes candidate public SaaS domains (`app.ekuaibao.com`, `dd2.hosecloud.com`, `wx2.ekuaibao.com`, `kdcloud2.ekuaibao.com`, `ddenterprise.ekuaibao.com`, `feishu.ekuaibao.com`) when `domain` is omitted, while supporting explicit custom domains for private cloud / dedicated tenants (e.g. 美年大健康). - **OpenAPI Role & Staff Discovery**: Added `seal-home corps hose-staffs` to query members under any role (defaults to `admin`, or business roles like `财务主管`, `采购申请权限`) and batch resolve member details (name, cellphone, activation status, third-party user ID) via `POST /api/openapi/v1/staffs/getStaffIds`. - **Strict Staff Selection Guard (Anti-Silent Activation)**: Guarded `seal-home corps add-hose` against silent administrator activation. When multiple candidate administrators exist, the system requires explicit selection (`staffId`, `staffName`, or `staffPhone`) or structured candidate confirmation. - **Dedicated Skill Reference**: Added `skills/seal-home/references/hose-enterprise-init.md` covering domain decision tiering, OpenAPI contracts, and non-TUI Agent autonomous workflows. --- ## [0.9.2] - 2026-08-25 ### Fixed & Enhanced - **Real-Time Streaming Download Progress in Self-Update**: Upgraded `seal-home update` to stream download progress, mirror probe status, and live percentages directly to `stderr` in real-time, eliminating silent waiting and terminal stalling during binary upgrades. - **Fast Mirror Connectivity Probes**: Added fast 10s connection timeouts and stream chunk tracking for Gitea, fast CDN proxies, and GitHub download candidates. --- ## [0.9.1] - 2026-08-25 ### Added - **Native HTTP REST API & Documentation Server**: Added `seal-home http [--port 8787] [--host 127.0.0.1]` and `seal-home serve` to start a zero-dependency local HTTP API server. - **Interactive API Reference (`/docs`)**: Built-in interactive Scalar API documentation rendering the full OpenAPI 3.1.0 specification. - **Agent CLI & Tool Execution Endpoints**: Added `POST /api/cli` (executing arbitrary seal-home commands over HTTP with JSON responses) and `POST /api/tool/:name` (invoking granular tools directly). - **Standard RESTful API Endpoints (`/v1/*`)**: Exposed OpenAPI-mapped RESTful endpoints for corps, whoami, approval runs, rules, simulations, and decision preferences. - **Full CORS & Enterprise Header Routing**: Enabled out-of-the-box CORS support and `X-Seal-Corp` header routing for web frontends, Dify, FastGPT, and external automation workflows. --- ## [0.9.0] - 2026-08-25 ### Added - **Multi-Platform Simulation & Lifecycle Management**: Added support for multi-source system simulation (`hosecloud`, `feishu`, `weaver`, `helios`, `maycur`, `material_pack`) along with `simulation wait ` (polling batch completion), `simulation clean ` (purging test data), and `simulation specifications` (listing available templates). - **HoseCloud Deployment & Outbound Sync**: Added `deploy hosecloud` command suite (`requirements`, `list`, `get`, `status`, `configure`, `sync`) for seamless tenant credential verification, integration management, and outbound webhook synchronization. - **Audit Decision Preferences & Thinking Depth Management**: Added `preference` command suite (`get`, `decision update`, `thinking-depth set`, `thinking-depth policies list|upsert|remove`) to configure immediate decision preferences, global default thinking depth, and routing policies. - **Approval Runs Analytics & Deduplication**: Added `approval-runs stats` (with status distribution, source system aggregation, and customizable deduplication by `sourceDocumentSN`, `sourceDocumentId`, or `id`) and `approval-runs count`. - **sealai-cli Feature Parity**: Full feature superset matching all capabilities and command ergonomics of `@sealai-official/cli` (v0.3.1). --- ## [0.8.1] - 2026-08-25 ### Added - **Automated Gitea Releases Dual-Publishing**: Automated cross-publishing of compiled standalone binary assets to both GitHub Releases and Gitea (`git.ying-qing.cn`) via GitHub Actions. - **Enhanced Installer Visuals**: Added real-time progress bar, source host identifier, and human-readable byte size indicators to `install.sh`. - **One-Command Version Bumping**: Added `bun run bump ` script to automatically synchronize all manifest, documentation, OpenAPI, and bundled assets. --- ## [0.8.0] - 2026-08-25 ### Added - **Multi-Source Download & Gitea Acceleration**: Enhanced `install.sh` and `seal-home update` with intelligent multi-source racing and automatic fallback across Gitea (`git.ying-qing.cn`), GitHub Releases, and CDN mirrors, achieving lightning-fast downloads in mainland China. - **Strict Anti-Rollback & Forward-Only Enforcement**: Guarded update commands against downgrades to prevent state schema and skill definition corruption. - **Release History & Changelog Introspection**: Integrated `seal-home changelog` and `update check` with publish timestamps, author identity, and intermediate version diff calculations. - **Automated CI Tag Release Notes**: Updated GitHub Actions release workflow to extract annotated git tag messages and append GitHub-generated PR and commit notes. --- ## [0.7.1] - 2026-08-25 ### Added - **Release History & Changelog Query**: Added `seal-home changelog` and `seal-home update check` with release publish timestamps, author info, and changelog body. - **Cross-Version Diff Tracking**: Automatically computes skipped/intermediate versions (`pendingReleases`) with commit notes when local version is behind. - **Strict Downgrade Protection (Anti-rollback Guard)**: Enforced forward-only updates. Attempts to downgrade to an older version (e.g. `seal-home update 0.3.3`) are strictly blocked with explicit guidance. - **Latest Keyword Normalization**: Normalized `seal-home update latest` and `--version latest` to point cleanly to the newest release. - **Approval Runs List Alias**: Added `seal-home approval-runs list` as a friendly alias for `approval-runs search`. ### Fixed - **UNIX Pipe EPIPE Handling**: Handled `EPIPE` broken pipe errors on `process.stdout` so piped commands (e.g. `seal-home openapi | head`) exit cleanly without dumping stack traces. - **Empty Filter Guidance**: Added friendly stderr diagnostics when queries (e.g. `approval-runs summary` or `corps list`) find no records for the current date/filter. --- ## [0.7.0] - 2026-08-25 ### Added - **Zero-Dependency Native Binaries**: Compiled standalone native executables for macOS (arm64/x64), Linux (x64/arm64), and Windows (x64) via Bun compiled standalone target. - **High-Speed Release Pipeline**: GitHub Actions multi-target cross-compilation pipeline delivering release assets in under 60 seconds. - **Sudo-Free One-Line Installer**: Created `scripts/install.sh` with automatic writable path detection (`/opt/homebrew/bin` → `/usr/local/bin` → `~/.local/bin`) and macOS ad-hoc code-signing. - **Strict POSIX Stream Isolation**: Guaranteed `stdout` emits 100% pure, parseable JSON for AI agents and scripts, while diagnostics and human onboarding tips route to `stderr`. - **Simulation Batch Management**: Added `simulation create` for both HoseCloud flow IDs and material package ZIP imports. - **In-place Self-Update**: `seal-home update` atomic binary replacement with automatic global skill directory synchronization. --- ## [0.3.3] - 2026-06-13 ### Added - Initial proof-of-concept release for Seal tenant operations and Hose approval automation.