adachsoft / changelog-tool
AI tool-call compatible wrapper around adachsoft/changelog-linter for managing changelog.json and CHANGELOG.md.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Forks: 0
pkg:composer/adachsoft/changelog-tool
Requires
- adachsoft/ai-tool-call: ^2.0.1
- adachsoft/changelog-linter: ^v0.3.0
- adachsoft/normalized-safe-path: ^0.1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.89
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.4
- rector/rector: ^2.3
This package is not auto-updated.
Last update: 2026-02-10 06:30:37 UTC
README
A thin AI tool-call compatible wrapper around adachsoft/changelog-linter for managing changelog.json and CHANGELOG.md.
Installation
Install via Composer:
composer require adachsoft/changelog-tool
Usage with adachsoft/ai-tool-call
Register the SPI factory in your ai-tool-call setup:
use AdachSoft\AiToolCall\PublicApi\Builder\AiToolCallFacadeBuilder;
use AdachSoft\AiToolCall\SPI\Collection\ConfigMap;
use AdachSoft\ChangelogTool\Tool\ChangelogToolFactory;
$facade = AiToolCallFacadeBuilder::new()
->withSpiFactories([
new ChangelogToolFactory(),
])
->withToolConfigs([
'changelog_tool' => new ConfigMap([
'base_path' => getcwd(),
'changelog_binary_path' => 'vendor/bin/changelog',
// Default locations and behaviour (config-only, not per-call parameters)
'json_path' => 'changelog.json',
'markdown_path' => 'CHANGELOG.md',
'timeout' => 900, // 15 minutes
'with_created_at' => true, // used for generate-json
'default_lenient' => false, // default when `lenient` is not provided per call
]),
])
->build();
Then call the tool from your agent or application:
use AdachSoft\AiToolCall\PublicApi\Dto\ToolCallRequestDto;
// Validate changelog.json (paths and behaviour come from ConfigMap)
$result = $facade->callTool(new ToolCallRequestDto(
toolName: 'changelog_tool',
parameters: [
'mode' => 'validate',
],
));
// Generate CHANGELOG.md from changelog.json
$result = $facade->callTool(new ToolCallRequestDto(
toolName: 'changelog_tool',
parameters: [
'mode' => 'generate_md',
],
));
// Generate changelog.json from CHANGELOG.md with lenient parsing
$result = $facade->callTool(new ToolCallRequestDto(
toolName: 'changelog_tool',
parameters: [
'mode' => 'generate_json',
'lenient' => true,
],
));
Parameters (per-call)
The changelog_tool exposes the following per-call parameters (snake_case):
mode(string, required): one ofvalidate,generate_md,generate_json.lenient(bool, optional): enable lenient parsing/validation for Markdown to JSON (when omitted,default_lenientfromConfigMapis used).
All file paths, timeout and with_created_at behaviour are configured only via ConfigMap in the factory, not as per-call parameters.
Configuration (ConfigMap keys)
The factory ChangelogToolFactory reads the following configuration keys:
base_path(string, required): project root used ascwdand base for resolving relative paths.changelog_binary_path(string, optional): path to thechangelogCLI, relative tobase_pathor absolute (default:vendor/bin/changelog).json_path(string, optional): default path tochangelog.json(default:changelog.json).markdown_path(string, optional): default path toCHANGELOG.md(default:CHANGELOG.md).timeout(int, optional): default timeout in seconds for the CLI process (default: 900 seconds).with_created_at(bool, optional): when generating JSON from Markdown, addcreatedAtmetadata (default:true).default_lenient(bool, optional): default value for lenient mode whenlenientis not provided per call (default:false).
Result shape
The tool always returns a structured result with the following keys:
stdout(string)stderr(string)exit_code(int)success(bool)
Paths in stdout/stderr are sanitized to remove the configured base_path prefix where applicable.