Skip to content
Merged
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
1 change: 0 additions & 1 deletion .distignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.claude
.datamachine
.github
.git
.gitignore
Expand Down
194 changes: 0 additions & 194 deletions .github/workflows/docs-agent.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/channels-workflows-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Canonical session rows should expose stable generic fields when available: `sess

Principal-aware stores should implement `WP_Agent_Principal_Conversation_Store` for non-user owners such as browser sessions, external channels, tokens, or system principals. Stores that hash or hide owner keys should also implement `WP_Agent_Principal_Conversation_Session_Reader` so `get`, `update-title`, and `delete` can verify ownership without exposing raw owner keys in generic rows.

Product-specific state belongs in `metadata` under namespaced keys. For example, Data Machine can keep read/progress/reporting fields under `metadata['data_machine']` while exposing the canonical Agents API fields to channel clients. Data Machine `datamachine/*chat-session*` abilities, REST routes, and CLI commands can then become compatibility/product aliases over its adapter instead of a parallel generic contract.
Product-specific state belongs in `metadata` under namespaced keys. For example, a consumer plugin can keep read/progress/reporting fields under `metadata['example_vendor']` while exposing the canonical Agents API fields to channel clients. Consumer-specific abilities, REST routes, and CLI commands can then become compatibility/product aliases over its adapter instead of a parallel generic contract.

Approval primitives live in `src/Approvals/`:

Expand Down
2 changes: 1 addition & 1 deletion docs/default-stores-companion.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Rationale:
core-review concern than a mandatory session post type.
- **Fallback only.** When enabled, the store registers on `wp_agent_conversation_store`
at low priority (5), so any host store registered at the default priority wins.
Data Machine and WordPress.com keep their own custom backends and never enable this.
Products with custom backends can keep their own stores and never enable this.

Implementation: `WP_Agent_Cpt_Conversation_Store`
(`src/Transcripts/class-wp-agent-cpt-conversation-store.php`), wired by
Expand Down
4 changes: 2 additions & 2 deletions docs/registry-and-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ Adapter identity and duplicate rules:
- Adapter implementations should key durable/runtime state by the normalized `(agent_slug, owner_user_id, instance_key)` tuple. Repeating materialization for the same tuple is idempotent and should return `updated`, `skipped`, `projected`, or another accurate `WP_Agent_Materialization_Result` status instead of creating a second logical agent.
- Registered definition updates for an existing slug reconcile the existing durable/runtime identity. The adapter decides which fields are mutable, how package provenance is compared, and whether user-modified runtime artifacts require approval.
- Removed definitions are represented by absence from the registered snapshot. Adapters that keep prior installed state may mark missing identities as `removed`, `disabled`, or `skipped` according to host policy; Agents API does not delete host state automatically.
- Source/provenance metadata remains generic. Producers should place JSON-friendly provenance in `WP_Agent::get_meta()` using keys such as `source_plugin`, `source_type`, `source_package`, and `source_version`; adapters may persist or report those values without interpreting them as a Data Machine concept.
- Source/provenance metadata remains generic. Producers should place JSON-friendly provenance in `WP_Agent::get_meta()` using keys such as `source_plugin`, `source_type`, `source_package`, and `source_version`; adapters may persist or report those values without interpreting them as a product-specific concept.

The installed-agent contract composes with package adoption but does not replace it. `WP_Agent_Package_Adoption_Orchestrator` handles artifact planning/application through artifact callbacks; the installed-agent state store handles the durable agent instance row or equivalent host record. Products such as Data Machine can implement both surfaces against their own storage and then project persisted agents into the request-local registry.
The installed-agent contract composes with package adoption but does not replace it. `WP_Agent_Package_Adoption_Orchestrator` handles artifact planning/application through artifact callbacks; the installed-agent state store handles the durable agent instance row or equivalent host record. Consumer products can implement both surfaces against their own storage and then project persisted agents into the request-local registry.

This is the durable boundary decision for installed agents: Agents API owns neutral shapes and projection; products own persistence, feature flags, materializers, memory scaffolding, access grants, tokens, logs, and user-facing approval UX.

Expand Down
2 changes: 1 addition & 1 deletion docs/runtime-and-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ $submission = AgentsAPI\AI\WP_Agent_Runtime_Tool_Lifecycle::submit_result(
);
```

Generic lifecycle events fire as WordPress actions: `agents_api_runtime_tool_request_created`, `agents_api_runtime_tool_result_submitted`, `agents_api_runtime_tool_request_timed_out`, and `agents_api_runtime_tool_request_resumed`. The event payloads contain normalized request/result envelopes plus caller-owned context. Agents API does not define Data Machine jobs, chat-session metadata, browser storage, or any other product-specific persistence shape.
Generic lifecycle events fire as WordPress actions: `agents_api_runtime_tool_request_created`, `agents_api_runtime_tool_result_submitted`, `agents_api_runtime_tool_request_timed_out`, and `agents_api_runtime_tool_request_resumed`. The event payloads contain normalized request/result envelopes plus caller-owned context. Agents API does not define product jobs, chat-session metadata, browser storage, or any other product-specific persistence shape.

## Runtime tool declarations

Expand Down
15 changes: 8 additions & 7 deletions src/Registry/register-agent-runtime-bundle-importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static function ( $result, array $spec, array $input = array(), int $index = 0 )
return null;
}

$slug = sanitize_title( $string_value( $input['slug'] ?? null, $spec['slug'] ?? null, $agent['agent_slug'] ?? null, $bundle['bundle_slug'] ?? null ) );
$slug = sanitize_title( $string_value( $input['slug'] ?? null, $spec['slug'] ?? null, $agent['agent_slug'] ?? null, $bundle['package_slug'] ?? null, $bundle['bundle_slug'] ?? null ) );
if ( '' === $slug ) {
return new WP_Error(
'wp_agent_runtime_bundle_missing_agent_slug',
Expand Down Expand Up @@ -228,14 +228,15 @@ static function ( $result, array $spec, array $input = array(), int $index = 0 )

$config = is_array( $agent['agent_config'] ?? null ) ? $agent['agent_config'] : array();
$meta = is_array( $agent['meta'] ?? null ) ? $agent['meta'] : array();
$bundle_slug = $string_value( $bundle['bundle_slug'] ?? null );
$bundle_version = $string_value( $bundle['bundle_version'] ?? null );
if ( '' !== $bundle_slug || '' !== $bundle_version ) {
$source_type = $string_value( $bundle['source_type'] ?? null, $spec['source_type'] ?? null, 'runtime-agent-package' );
$source_package = $string_value( $bundle['source_package'] ?? null, $spec['source_package'] ?? null, $bundle['package_slug'] ?? null, $spec['package_slug'] ?? null, $bundle['bundle_slug'] ?? null );
$source_version = $string_value( $bundle['source_version'] ?? null, $spec['source_version'] ?? null, $bundle['package_version'] ?? null, $spec['package_version'] ?? null, $bundle['bundle_version'] ?? null );
if ( '' !== $source_package || '' !== $source_version ) {
$meta = array_merge(
array(
'source_type' => 'runtime-agent-bundle',
'source_package' => $bundle_slug,
'source_version' => $bundle_version,
'source_type' => $source_type,
'source_package' => $source_package,
'source_version' => $source_version,
),
$meta
);
Expand Down
4 changes: 2 additions & 2 deletions tests/agents-chat-ability-smoke.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ function smoke_assert( $expected, $actual, string $name, array &$failures, int &
$runtime_principal = AgentsAPI\AI\WP_Agent_Execution_Principal::runtime(
'runtime-session-1',
'sandbox-agent',
array( 'source' => 'wp-codebox' ),
array( 'source' => 'example-runtime' ),
'workspace:demo',
'wp-codebox-cli',
'example-runtime-cli',
array( AgentsAPI\AI\WP_Agent_Execution_Principal::AUDIENCE_CLAIM_RUNTIME_TYPE => 'wordpress-playground' )
)->to_array();
$captured_principal = array();
Expand Down
Loading
Loading