Skip to content

Tools options#134

Merged
gohabereg merged 28 commits intomainfrom
feature/tool-options
May 7, 2026
Merged

Tools options#134
gohabereg merged 28 commits intomainfrom
feature/tool-options

Conversation

@gohabereg
Copy link
Copy Markdown
Member

Move all tool's static configuration properties to the single options property

@gohabereg gohabereg requested a review from Copilot May 4, 2026 14:02
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

⏭️ No files to mutate for ./packages/model

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

⏭️ No files to mutate for ./packages/dom-adapters

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Coverage report for ./packages/dom-adapters

St.
Category Percentage Covered / Total
🟢 Statements 96.43% 27/28
🟢 Branches 86.96% 20/23
🟢 Functions 100% 5/5
🟢 Lines 96.43% 27/28

Test suite run success

11 tests passing in 2 suites.

Report generated by 🧪jest coverage report action from c0e2d79

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Coverage report for ./packages/core

St.
Category Percentage Covered / Total
🟢 Statements 100% 129/129
🟢 Branches 100% 47/47
🟢 Functions 100% 27/27
🟢 Lines 100% 120/120

Test suite run success

75 tests passing in 7 suites.

Report generated by 🧪jest coverage report action from c0e2d79

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Coverage report for ./packages/ot-server

St.
Category Percentage Covered / Total
🟡 Statements 70.97% 22/31
🔴 Branches 20% 1/5
🟡 Functions 75% 6/8
🟡 Lines 68.97% 20/29

Test suite run success

4 tests passing in 1 suite.

Report generated by 🧪jest coverage report action from c0e2d79

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Coverage report for ./packages/collaboration-manager

St.
Category Percentage Covered / Total
🟢 Statements 92.51% 358/387
🟢 Branches 85.51% 118/138
🟢 Functions 98.15% 53/54
🟢 Lines 92.41% 353/382

Test suite run success

117 tests passing in 7 suites.

Report generated by 🧪jest coverage report action from c0e2d79

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Coverage report for ./packages/model

St.
Category Percentage Covered / Total
🟢 Statements 99.8% 988/990
🟢 Branches 98.98% 292/295
🟢 Functions 97.45% 229/235
🟢 Lines 99.79% 948/950

Test suite run success

538 tests passing in 25 suites.

Report generated by 🧪jest coverage report action from c0e2d79

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

⏭️ No files to mutate for ./packages/core

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates tool static configuration into a single static options property across tool types (block/inline/tune), updating SDK typings and core tool registration/initialization paths accordingly.

Changes:

  • Introduces canonical option-key enums and per-tool *ToolOptions interfaces, and updates tool constructor types to use static options.
  • Updates SDK facades to read tool configuration from constructable.options (and to narrow useToolOptions typings per tool kind).
  • Updates Core tool registration flow (Core.use, ToolsManager.prepareTools, ToolsFactory) to accept ToolStaticOptions as the tool settings shape.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/sdk/src/tools/facades/InlineToolFacade.ts Switches inline tool title lookup to static options and narrows useToolOptions typing.
packages/sdk/src/tools/facades/BlockToolFacade.ts Reads block tool static settings from constructable.options and narrows useToolOptions typing.
packages/sdk/src/tools/facades/BaseToolFacade.ts Removes legacy internal settings enums, adds option-key re-exports, and uses constructable.options for merged options/config.
packages/sdk/src/entities/BaseTool.ts Defines shared BaseToolOptionKey, BaseToolOptions, ToolStaticOptions, and updates BaseToolConstructor to carry typed options.
packages/sdk/src/entities/InlineTool.ts Adds InlineToolOptionKey + InlineToolOptions and updates InlineToolConstructor to use typed static options.
packages/sdk/src/entities/BlockTool.ts Adds BlockToolOptionKey + BlockToolOptions and updates BlockToolConstructor to use typed static options.
packages/sdk/src/entities/BlockTune.ts Adds BlockTuneOptions and updates BlockTuneConstructor to use typed static options.
packages/sdk/src/entities/index.ts Re-exports BaseTool types to make the new option/type surface available via entities index.
packages/core/src/tools/ToolsManager.ts Updates prepareTools signature to accept ToolStaticOptions settings for tool preparation.
packages/core/src/tools/ToolsFactory.ts Updates tool settings model to be ToolStaticOptions + class, and adapts registration to accept optional options.
packages/core/src/tools/internal/inline-tools/link/index.ts Migrates Link inline tool static title to static options and adds explicit tool name.
packages/core/src/tools/internal/inline-tools/italic/index.ts Migrates Italic inline tool static title to static options and adds explicit tool name.
packages/core/src/tools/internal/inline-tools/bold/index.ts Migrates Bold inline tool static title to static options and adds explicit tool name.
packages/core/src/index.ts Updates Core.use and tool initialization wiring to use ToolStaticOptions for per-tool settings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/tools/ToolsManager.ts Outdated
Comment on lines +17 to +18
ToolConstructable,
ToolStaticOptions
Comment thread packages/core/src/index.ts Outdated
Comment on lines +196 to +198
const blockTools = this.#plugins.getAll<[BlockToolConstructor, ToolStaticOptions]>(ToolType.Block);
const inlineTools = this.#plugins.getAll<[InlineToolConstructor, ToolStaticOptions]>(ToolType.Inline);
const blockTunes = this.#plugins.getAll<[BlockTuneConstructor, ToolStaticOptions]>(ToolType.Tune);
*/
public get title(): string | undefined {
return this.constructable[InternalInlineToolSettings.Title];
return this.constructable.options?.[InlineToolOptionKey.Title];
Comment thread packages/sdk/src/tools/facades/InlineToolFacade.ts
@gohabereg gohabereg requested review from e11sy and neSpecc May 7, 2026 16:39
Base automatically changed from feature/block-id to main May 7, 2026 20:08
@gohabereg gohabereg added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit febde03 May 7, 2026
24 checks passed
@gohabereg gohabereg deleted the feature/tool-options branch May 7, 2026 20:19
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.

4 participants