Skip to content
Closed
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
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,15 @@ jobs:
# in the default ./tests, which in this repo holds unrelated CLI
# fixtures. Without it nothing is bound and every test errors.
#
# continue-on-error while the suite is brought up: as of 2026-08-01 it
# runs 1302 tests, 993 passing and 303 failing — the failures are real
# and tracked (Livewire view stubs, the missing Core\Mcp dependency
# trait), not flakes. Drop this flag once the count reaches zero.
# continue-on-error while the suite is brought up: as of 2026-08-08 it
# runs 1311 tests, 1155 passing and 156 failing, with nothing skipped or
# excluded. The failures are real and tracked, not flakes — the largest
# remaining groups are the Core\Mcp tools (Core\Mcp\Tools\Concerns\
# ValidatesDependencies and Core\Mcp\Dependencies\HasDependencies live in
# dappcore/mcp, which is not a dependency here and collides with this
# package's own Core\Mcp\ PSR-4 root), the admin Livewire view stubs, and
# tests that reach a live Qdrant or Elasticsearch. Drop this flag once
# the count reaches zero.
continue-on-error: true
run: ./vendor/bin/pest --test-directory=php/tests --coverage --coverage-clover=coverage.xml
- name: Upload PHP coverage to Codecov
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"spatie/laravel-activitylog": "^4.8"
},
"require-dev": {
"dappcore/php-content": "^0.1",
"dappcore/php-tenant": "^0.1",
"laravel/pint": "^1.18",
"livewire/livewire": "^3.0",
Expand Down
127 changes: 126 additions & 1 deletion composer.lock

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

14 changes: 8 additions & 6 deletions php/Console/Commands/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
namespace Core\Mod\Agentic\Console\Commands;

use Core\Mod\Agentic\Models\AgentPlan;
use Core\Mod\Content\Jobs\GenerateContentJob;
use Core\Mod\Content\Models\AIUsage;
use Core\Mod\Content\Models\ContentBrief;
use Core\Mod\Content\Services\AIGatewayService;
use Illuminate\Console\Command;
use Mod\Content\Jobs\GenerateContentJob;
use Mod\Content\Models\ContentBrief;
use Mod\Content\Services\AIGatewayService;
use Illuminate\Support\Str;

class GenerateCommand extends Command
{
Expand Down Expand Up @@ -104,7 +106,7 @@ protected function generateBrief(): int
// Create brief
$brief = ContentBrief::create([
'title' => $title,
'slug' => \Illuminate\Support\Str::slug($title),
'slug' => Str::slug($title),
'content_type' => $this->option('type'),
'service' => $this->option('service'),
'keywords' => $this->option('keywords')
Expand Down Expand Up @@ -268,7 +270,7 @@ protected function generateFromPlan(): int
// Create brief from task
$brief = ContentBrief::create([
'title' => $taskName,
'slug' => \Illuminate\Support\Str::slug($taskName).'-'.time(),
'slug' => Str::slug($taskName).'-'.time(),
'content_type' => $this->option('type'),
'service' => $this->option('service') ?? ($plan->metadata['service'] ?? null),
'target_word_count' => (int) $this->option('words'),
Expand Down Expand Up @@ -333,7 +335,7 @@ protected function showQueueStats(): int
$this->newLine();
$this->line(' <comment>AI Usage (This Month):</comment>');

$usage = \Mod\Content\Models\AIUsage::thisMonth()
$usage = AIUsage::thisMonth()
->selectRaw('provider, SUM(input_tokens) as input, SUM(output_tokens) as output, SUM(cost_estimate) as cost')
->groupBy('provider')
->get();
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion php/Jobs/BatchContentGeneration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace Core\Mod\Agentic\Jobs;

use Core\Mod\Content\Models\ContentTask;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use Mod\Content\Models\ContentTask;

class BatchContentGeneration implements ShouldQueue
{
Expand Down
14 changes: 11 additions & 3 deletions php/Jobs/ProcessContentTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace Core\Mod\Agentic\Jobs;

use Core\Mod\Agentic\Services\AgenticManager;
use Core\Mod\Content\Models\ContentTask;
use Core\Tenant\Services\EntitlementService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Mod\Content\Models\ContentTask;
use Throwable;

class ProcessContentTask implements ShouldQueue
Expand Down Expand Up @@ -51,7 +51,12 @@ public function handle(
$result = $entitlements->can($workspace, 'ai.credits');

if ($result->isDenied()) {
$this->task->markFailed("Entitlement denied: {$result->message}");
// getMessage(), not ->message: EntitlementResult carries the text
// as a readonly $reason and exposes it through getMessage(). There
// is no $message property and no __get, so this interpolated an
// undefined property and every denial was recorded with an empty
// reason.
$this->task->markFailed("Entitlement denied: {$result->getMessage()}");

return;
}
Expand Down Expand Up @@ -111,7 +116,10 @@ public function failed(Throwable $exception): void
private function interpolateVariables(string $template, array $data): string
{
foreach ($data as $key => $value) {
$placeholder = '{{{'.$key.'}}}';
// Two braces, not three. Every prompt template in the package writes
// {{name}}, so the three-brace placeholder never matched anything and
// user templates reached the provider with their variables intact.
$placeholder = '{{'.$key.'}}';

if (is_string($value)) {
$template = str_replace($placeholder, $value, $template);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,6 @@ private function normaliseMemory(array|BrainMemory $memory): array
*/
protected function viewPath(): string
{
return __DIR__.'/../../resources/views/livewire/agentic/brain-explorer.blade.php';
return __DIR__.'/../resources/views/livewire/agentic/brain-explorer.blade.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,6 @@ private function syncSelectedAgentId(): void
*/
protected function viewPath(): string
{
return __DIR__.'/../../resources/views/livewire/agentic/credit-ledger.blade.php';
return __DIR__.'/../resources/views/livewire/agentic/credit-ledger.blade.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,6 @@ private function summariseBudget(array $budget): string
*/
protected function viewPath(): string
{
return __DIR__.'/../../resources/views/livewire/agentic/fleet-overview.blade.php';
return __DIR__.'/../resources/views/livewire/agentic/fleet-overview.blade.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* {
* protected function viewPath(): string
* {
* return __DIR__.'/../../resources/views/livewire/agentic/fleet-overview.blade.php';
* return __DIR__.'/../resources/views/livewire/agentic/fleet-overview.blade.php';
* }
* }
*/
Expand Down
2 changes: 1 addition & 1 deletion php/Mcp/Resources/ContentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

namespace Core\Mcp\Resources;

use Core\Mod\Content\Models\ContentItem;
use Core\Tenant\Models\Workspace;
use Laravel\Mcp\Request;
use Laravel\Mcp\Response;
use Laravel\Mcp\Server\Resource;
use Mod\Content\Models\ContentItem;
use Symfony\Component\Yaml\Yaml;

// Not final: resolveWorkspace / resolveContentItem / listResources are
Expand Down
4 changes: 2 additions & 2 deletions php/Mcp/Tools/Agent/Content/ContentBatchGenerate.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Core\Mod\Agentic\Mcp\Tools\Agent\Content;

use Core\Mod\Agentic\Mcp\Tools\Agent\AgentTool;
use Mod\Content\Jobs\GenerateContentJob;
use Mod\Content\Models\ContentBrief;
use Core\Mod\Content\Jobs\GenerateContentJob;
use Core\Mod\Content\Models\ContentBrief;

/**
* Queue multiple briefs for batch content generation.
Expand Down
4 changes: 2 additions & 2 deletions php/Mcp/Tools/Agent/Content/ContentBriefCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

use Core\Mod\Agentic\Mcp\Tools\Agent\AgentTool;
use Core\Mod\Agentic\Models\AgentPlan;
use Core\Mod\Content\Enums\BriefContentType;
use Core\Mod\Content\Models\ContentBrief;
use Illuminate\Support\Str;
use Mod\Content\Enums\BriefContentType;
use Mod\Content\Models\ContentBrief;

/**
* Create a content brief for AI generation.
Expand Down
4 changes: 2 additions & 2 deletions php/Mcp/Tools/Agent/Content/ContentBriefGet.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Core\Mod\Agentic\Mcp\Tools\Agent\Content;

use Core\Mod\Agentic\Mcp\Tools\Agent\AgentTool;
use Mod\Content\Enums\BriefContentType;
use Mod\Content\Models\ContentBrief;
use Core\Mod\Content\Enums\BriefContentType;
use Core\Mod\Content\Models\ContentBrief;

/**
* Get details of a specific content brief including generated content.
Expand Down
4 changes: 2 additions & 2 deletions php/Mcp/Tools/Agent/Content/ContentBriefList.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Core\Mod\Agentic\Mcp\Tools\Agent\Content;

use Core\Mod\Agentic\Mcp\Tools\Agent\AgentTool;
use Mod\Content\Enums\BriefContentType;
use Mod\Content\Models\ContentBrief;
use Core\Mod\Content\Enums\BriefContentType;
use Core\Mod\Content\Models\ContentBrief;

/**
* List content briefs with optional status filter.
Expand Down
6 changes: 3 additions & 3 deletions php/Mcp/Tools/Agent/Content/ContentFromPlan.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

use Core\Mod\Agentic\Mcp\Tools\Agent\AgentTool;
use Core\Mod\Agentic\Models\AgentPlan;
use Core\Mod\Content\Enums\BriefContentType;
use Core\Mod\Content\Jobs\GenerateContentJob;
use Core\Mod\Content\Models\ContentBrief;
use Illuminate\Support\Str;
use Mod\Content\Enums\BriefContentType;
use Mod\Content\Jobs\GenerateContentJob;
use Mod\Content\Models\ContentBrief;

/**
* Create content briefs from plan tasks and queue for generation.
Expand Down
6 changes: 3 additions & 3 deletions php/Mcp/Tools/Agent/Content/ContentGenerate.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Core\Mod\Agentic\Mcp\Tools\Agent\Content;

use Core\Mod\Agentic\Mcp\Tools\Agent\AgentTool;
use Mod\Content\Jobs\GenerateContentJob;
use Mod\Content\Models\ContentBrief;
use Mod\Content\Services\AIGatewayService;
use Core\Mod\Content\Jobs\GenerateContentJob;
use Core\Mod\Content\Models\ContentBrief;
use Core\Mod\Content\Services\AIGatewayService;

/**
* Generate content for a brief using AI pipeline.
Expand Down
Loading
Loading