Skip to content

docs(inline-tools): document static prepare() and reset() - #3028

Open
TeacherXiao wants to merge 1 commit into
codex-team:nextfrom
TeacherXiao:docs/inline-tool-prepare-reset
Open

TeacherXiao wants to merge 1 commit into
codex-team:nextfrom
TeacherXiao:docs/inline-tool-prepare-reset

Conversation

@TeacherXiao

Copy link
Copy Markdown

Description

The Inline Tools documentation (docs/tools-inline.md) does not mention the static prepare() method, although it is supported for inline tools just like for block tools (see docs/tools.md). The companion static reset() method is also undocumented there.

This PR adds both lifecycle hooks to the Inline Tools docs:

  • prepare() — prepare Tool's data on Editor's initialization (static)
  • reset() — clean up Tool's data on Editor's destroy (static)

The new sections follow the same structure and style as the existing static get sanitize section (description, code example, parameters table, return value).

Fixes #2401

The Inline Tools API listed the optional instance methods but never
mentioned the static lifecycle hooks, even though the engine calls them
for Inline Tools exactly like it does for Block Tools and Block Tunes:
Tools.getListOfPrepareFunctions() walks the whole tools config, and
Tools.destroy() resets every available tool.

Both hooks are part of the shipped contract
(BaseToolConstructable.prepare/reset) and are already covered by
test/cypress/tests/tools/InlineTool.cy.ts, so this only fills the
documentation gap. The wording mirrors the existing Block Tunes sections.

Fixes codex-team#2401
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.

Documentation for Inline Tools does not include a static "prepare" method

1 participant