Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Agent memory files (MEMORY.md, SOUL.md, USER.md, NETWORK.md, AGENTS.md, plus any
add_filter(
'agents_api_memory_store',
function ( $store, $scope ) {
// Return an AgentMemoryStoreInterface to replace the disk default
// Return an WP_Agent_Memory_Store to replace the disk default
// for this scope, or null to let Data Machine read/write through
// the filesystem.
return new My_DB_Agent_Memory_Store();
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"require": {
"php": ">=8.2",
"woocommerce/action-scheduler": "^3.9",
"automattic/agents-api": "dev-main",
"chubes4/block-format-bridge": "^0.6"
},
"require-dev": {
"automattic/agents-api": "dev-main",
"php-stubs/wordpress-stubs": "^6.9",
"wp-coding-standards/wpcs": "^3.1",
"phpcsstandards/phpcsutils": "^1.0",
Expand Down
136 changes: 68 additions & 68 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions data-machine.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Version: 0.103.14
* Requires at least: 6.9
* Requires PHP: 8.2
* Requires Plugins: agents-api
* Author: Chris Huber, extrachill
* Author URI: https://chubes.net
* License: GPL v2 or later
Expand All @@ -28,13 +29,6 @@

require_once __DIR__ . '/vendor/autoload.php';

if ( ! defined( 'AGENTS_API_LOADED' ) ) {
$datamachine_agents_api_bootstrap = __DIR__ . '/vendor/automattic/agents-api/agents-api.php';
if ( file_exists( $datamachine_agents_api_bootstrap ) ) {
require_once $datamachine_agents_api_bootstrap;
}
}

// WP-CLI integration
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once __DIR__ . '/inc/Cli/Bootstrap.php';
Expand Down
8 changes: 4 additions & 4 deletions docs/ai-tools/tools-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,11 @@ add_filter('datamachine_tool_enabled', function($enabled, $tool_id, $agent_type)

### Parameter Building

`ToolParameters` (`/inc/Engine/AI/Tools/ToolParameters.php`) provides unified parameter construction:
`WP_Agent_Tool_Parameters` (`/inc/Engine/AI/Tools/ToolParameters.php`) provides unified parameter construction:

**Standard Tools** (global tools):
```php
$parameters = \DataMachine\Engine\AI\ToolParameters::buildParameters(
$parameters = \DataMachine\Engine\AI\WP_Agent_Tool_Parameters::buildParameters(
$data,
$job_id,
$flow_step_id
Expand All @@ -533,7 +533,7 @@ $parameters = \DataMachine\Engine\AI\ToolParameters::buildParameters(

**Handler Tools** (publish/upsert handlers):
```php
$parameters = \DataMachine\Engine\AI\ToolParameters::buildForHandlerTool(
$parameters = \DataMachine\Engine\AI\WP_Agent_Tool_Parameters::buildForHandlerTool(
$data,
$tool_def,
$job_id,
Expand Down Expand Up @@ -658,7 +658,7 @@ AI agents receive available tools based on:
- Handler tool and global tool integration
- Tool configuration validation

**ToolParameters** (`/inc/Engine/AI/Tools/ToolParameters.php`):
**WP_Agent_Tool_Parameters** (`/inc/Engine/AI/Tools/ToolParameters.php`):
- Centralized parameter building for all AI tools
- `buildParameters()` for standard AI tools with clean data extraction
- `buildForHandlerTool()` for handler tools with engine parameters (source_url, image_url)
Expand Down
4 changes: 2 additions & 2 deletions docs/api/endpoints/chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ The Chat endpoint uses the Universal Engine architecture at `/inc/Engine/AI/` fo
- Tool call/result message generation
- Duplicate detection logic

**ToolParameters**
**WP_Agent_Tool_Parameters**
- Unified parameter building for tools
- Automatic content/title extraction
- Session context integration
Expand Down Expand Up @@ -290,7 +290,7 @@ $context = [
Used by:
- RequestBuilder for directive application
- ToolExecutor for tool execution
- ToolParameters for parameter building
- WP_Agent_Tool_Parameters for parameter building

### Tool Discovery

Expand Down
10 changes: 5 additions & 5 deletions docs/api/endpoints/parameter-systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Data Machine uses an engine data filter architecture that provides clean data se
1. **Engine Data Propagation** - Fetch handlers store engine data via centralized filters; engine bundles the data into the payload passed to every step and tool
2. **Clean Data Separation** - AI receives clean data packets without URLs; handlers receive engine parameters via the payload-supplied engine data
3. **Unified Interface** - All steps, handlers, and tools use consistent parameter formats with required `job_id` for engine data access
4. **Tool-Based Parameter Building** - ToolParameters class (Universal Engine) provides standardized parameter construction
4. **Tool-Based Parameter Building** - WP_Agent_Tool_Parameters class (Universal Engine) provides standardized parameter construction
5. **Required Job ID** - All tools must include `job_id` parameter to enable engine data access and workflow continuity

## Core Payload Structure
Expand Down Expand Up @@ -117,12 +117,12 @@ class MyFetchHandler {
```

### Publish Handlers (Tool-Based)
Use `ToolParameters::buildForHandlerTool()` for parameter building with engine data access:
Use `WP_Agent_Tool_Parameters::buildForHandlerTool()` for parameter building with engine data access:

```php
class MyPublishHandler {
public function handle_tool_call(array $parameters, array $tool_def = []): array {
// Parameters built by ToolParameters::buildParameters()
// Parameters built by WP_Agent_Tool_Parameters::buildParameters()
// Already contain: content, title, job_id, flow_step_id, handler_config
// Engine data accessed via filter for handler tools

Expand Down Expand Up @@ -165,7 +165,7 @@ class MyUpdateHandler {

## AI Tool Parameter Building

### ToolParameters Class (Universal Engine)
### WP_Agent_Tool_Parameters Class (Universal Engine)
**File**: `/inc/Engine/AI/Tools/ToolParameters.php`
**Since**: 0.2.0

Expand All @@ -175,7 +175,7 @@ Centralized parameter building for AI tool execution:
use DataMachine\Engine\AI\Tools\ToolParameters;

// Unified parameter building for all tool types
$parameters = ToolParameters::buildParameters(
$parameters = WP_Agent_Tool_Parameters::buildParameters(
$ai_tool_parameters, // Parameters from AI tool call
$payload, // Step payload (job_id, flow_step_id, data, flow_step_config, engine_data)
$tool_definition // Tool definition array
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ Data Machine v0.2.0 introduced a universal Engine layer (`/inc/Engine/AI/`) that

- **AIConversationLoop**: Multi-turn conversation execution with tool calling, completion detection, and state management
- **ToolExecutor**: Universal tool discovery, enablement validation, and execution across agent types
- **ToolParameters**: Centralized parameter building for AI tools with data packet integration
- **WP_Agent_Tool_Parameters**: Centralized parameter building for AI tools with data packet integration
- **ConversationManager**: Message formatting and conversation state management
- **RequestBuilder**: AI request construction with directive application and tool restructuring
- **ToolResultFinder**: Utility for finding tool execution results in data packets
Expand Down Expand Up @@ -453,7 +453,7 @@ Complete extension system for custom handlers and tools:
- **Universal Engine Architecture**: Shared AI infrastructure via `/inc/Engine/AI/` components:
- AIConversationLoop for multi-turn conversation execution with automatic tool calling
- ToolExecutor for universal tool discovery and execution
- ToolParameters for centralized parameter building (`buildParameters()` for standard tools, `buildForHandlerTool()` for handler tools with engine data)
- WP_Agent_Tool_Parameters for centralized parameter building (`buildParameters()` for standard tools, `buildForHandlerTool()` for handler tools with engine data)
- ConversationManager for message formatting and conversation utilities
- RequestBuilder for centralized AI request construction with directive application
- ToolResultFinder for universal tool result search in data packets
Expand Down
14 changes: 7 additions & 7 deletions docs/architecture/agent-memory-backends.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This lets self-hosted installs keep the current disk-backed workflow while manag

## Logical Identity

Every memory file is addressed by an `AgentMemoryScope` four-tuple:
Every memory file is addressed by an `WP_Agent_Memory_Scope` four-tuple:

```text
(layer, user_id, agent_id, filename)
Expand Down Expand Up @@ -43,7 +43,7 @@ AgentMemoryStoreFactory
|
+--> DiskAgentMemoryStore (default)
|
+--> alternate AgentMemoryStoreInterface implementation
+--> alternate WP_Agent_Memory_Store implementation
```

`MemoryFileRegistry` is the source of truth for which core memory files exist, where they live logically, and which modes receive them. Registration metadata includes the layer, priority, editability, `modes`, whether a file is composable, and optional `convention_path` disk projection metadata.
Expand All @@ -68,11 +68,11 @@ Data Machine resolves memory persistence through one current Agents API-shaped f
apply_filters(
'agents_api_memory_store',
null,
AgentMemoryScope $scope
WP_Agent_Memory_Scope $scope
);
```

Return an `AgentMemoryStoreInterface` implementation to replace the disk default for the given scope. Return `null` to keep `DiskAgentMemoryStore`.
Return an `WP_Agent_Memory_Store` implementation to replace the disk default for the given scope. Return `null` to keep `DiskAgentMemoryStore`.

`agents_api_memory_store` replaces the earlier `datamachine_memory_store` name in-place. Data Machine intentionally does not call both filters; consumers should migrate to the Agents API-shaped hook rather than relying on a permanent alias.

Expand All @@ -92,7 +92,7 @@ DMC should be treated as a projection provider, not the memory model:

| Concern | Owner |
|---|---|
| Logical memory identity and access | Data Machine (`AgentMemoryScope`, `AgentMemory`) |
| Logical memory identity and access | Data Machine (`WP_Agent_Memory_Scope`, `AgentMemory`) |
| Registered memory files and mode-aware injection | Data Machine (`MemoryFileRegistry`, directives) |
| Disk file projection for local coding agents | DMC + `DiskAgentMemoryStore` environment capability |
| Managed-host alternate backend | Consumer plugin via `agents_api_memory_store` |
Expand All @@ -118,7 +118,7 @@ The memory-store seam is not a replacement for AI Framework. Data Machine still
## Extension Rules

- Read and write memory through `AgentMemory`, not `AgentMemoryStoreFactory` directly.
- Implement `AgentMemoryStoreInterface` when replacing persistence.
- Implement `WP_Agent_Memory_Store` when replacing persistence.
- Preserve the four-tuple identity model exactly, even if the physical backend has different keys.
- Keep section parsing, scaffolding, editability gating, ability permissions, prompt-injection policy, and registry semantics above the store layer.
- Gate guideline-backed stores on real substrate availability; do not assume `wp_guideline` exists.
Expand All @@ -129,4 +129,4 @@ The memory-store seam is not a replacement for AI Framework. Data Machine still
- [WordPress as Persistent Memory for AI Agents](../core-system/wordpress-as-agent-memory.md)
- [Memory Policy](../core-system/memory-policy.md)
- [Daily Memory System](../core-system/daily-memory-system.md)
- [Core Filters: AgentMemoryStoreInterface](../development/hooks/core-filters.md#agentmemorystoreinterface-inccorefilesrepositoryagentmemorystoreinterfacephp)
- [Core Filters: WP_Agent_Memory_Store](../development/hooks/core-filters.md#agentmemorystoreinterface-inccorefilesrepositoryagentmemorystoreinterfacephp)
Loading
Loading