Skip to content

feat: extract shared hook types into tokf-hook-types crate#314

Merged
mpecan merged 4 commits intomainfrom
feat/tokf-hook-types
Mar 26, 2026
Merged

feat: extract shared hook types into tokf-hook-types crate#314
mpecan merged 4 commits intomainfrom
feat/tokf-hook-types

Conversation

@mpecan
Copy link
Copy Markdown
Owner

@mpecan mpecan commented Mar 26, 2026

Summary

  • Extract ExternalEngineConfig, ErrorFallback, HookFormat, PermissionVerdict, RewriteConfig, PermissionsConfig, and related types into a new tokf-hook-types crate
  • Enables external tools to share the config format without duplicating type definitions or risking format drift
  • Adds Serialize derives for round-trip TOML support, skip_serializing_if for clean output, and Default impl for ExternalEngineConfig
  • tokf-cli re-exports all types from the new crate for full backward compatibility

Test plan

  • cargo fmt && cargo clippy --all-targets -- -D warnings passes
  • All 1359 tokf tests pass (0 failures)
  • tokf-hook-types builds with only serde dependency
  • Verify tokf-cli re-exports work correctly (no API breakage)

🤖 Generated with Claude Code

mpecan and others added 4 commits March 25, 2026 17:23
…link

- Clarify that without an external engine, tokf does NO permission
  checking -- the AI tool handles its own rules natively
- Add hook JSON reference section for engine developers with concrete
  request/response examples for Claude Code, Gemini CLI, and Cursor
- Document non-zero exit code + valid JSON behaviour (Dippy compat)
- Add permission engines section to integrations.md with Dippy link
- Document tokf hook handle --format command and its values
- Regenerate README.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract ExternalEngineConfig, ErrorFallback, HookFormat, PermissionVerdict,
RewriteConfig, PermissionsConfig, and related types into a new
tokf-hook-types crate so external tools (like rippy) can share the
config format without duplicating type definitions.

- Add Serialize derives to all extracted types for round-trip TOML support
- Add skip_serializing_if for empty default fields (args, format_map, rewrite)
- Add Default impl for ExternalEngineConfig with correct timeout_ms
- tokf-cli re-exports from tokf-hook-types for backward compatibility

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bump version to 0.2.38 to match linked workspace versions, add the
crate to release-please config/manifest, and insert a publish step
in release.yml between tokf-common and tokf-filter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@repository-butler
Copy link
Copy Markdown
Contributor

Filter Verification Report

Changed Filters

No filter files changed in this PR.

All Filters Summary

✅ 132/132 test cases passed across 49 filters


Generated by tokf verify

@mpecan mpecan merged commit 40148bf into main Mar 26, 2026
5 checks passed
@mpecan mpecan deleted the feat/tokf-hook-types branch March 26, 2026 12:42
@repository-butler repository-butler bot mentioned this pull request Mar 26, 2026
mpecan pushed a commit that referenced this pull request Mar 26, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>e2e-tests: 0.1.27</summary>

### Dependencies


</details>

<details><summary>tokf-common: 0.2.39</summary>

##
[0.2.39](tokf-common-v0.2.38...tokf-common-v0.2.39)
(2026-03-26)


### Miscellaneous

* **tokf-common:** Synchronize workspace versions
</details>

<details><summary>tokf-filter: 0.2.39</summary>

##
[0.2.39](tokf-filter-v0.2.38...tokf-filter-v0.2.39)
(2026-03-26)


### Miscellaneous

* **tokf-filter:** Synchronize workspace versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * tokf-common bumped from 0.2.38 to 0.2.39
</details>

<details><summary>tokf-hook-types: 0.2.39</summary>

##
[0.2.39](tokf-hook-types-v0.2.38...tokf-hook-types-v0.2.39)
(2026-03-26)


### Features

* extract shared hook types into tokf-hook-types crate
([#314](#314))
([40148bf](40148bf))
</details>

<details><summary>tokf-server: 0.2.39</summary>

##
[0.2.39](tokf-server-v0.2.38...tokf-server-v0.2.39)
(2026-03-26)


### Miscellaneous

* **tokf-server:** Synchronize workspace versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * tokf-common bumped from 0.2.38 to 0.2.39
    * tokf-filter bumped from 0.2.38 to 0.2.39
</details>

<details><summary>catalog-types: 0.2.39</summary>

##
[0.2.39](catalog-types-v0.2.38...catalog-types-v0.2.39)
(2026-03-26)


### Miscellaneous

* **catalog-types:** Synchronize workspace versions
</details>

<details><summary>tokf: 0.2.39</summary>

##
[0.2.39](tokf-v0.2.38...tokf-v0.2.39)
(2026-03-26)


### Features

* extract shared hook types into tokf-hook-types crate
([#314](#314))
([40148bf](40148bf))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * tokf-common bumped from 0.2.38 to 0.2.39
    * tokf-filter bumped from 0.2.38 to 0.2.39
    * tokf-hook-types bumped from 0.2.38 to 0.2.39
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: repository-butler[bot] <166800726+repository-butler[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant