'object', 'properties' => [ 'path' => [ 'type' => 'string', 'description' => 'File or resource path', ], 'action' => [ 'type' => 'string', 'description' => 'Action performed', 'enum' => ['created', 'modified', 'deleted', 'reviewed'], ], 'description' => [ 'type' => 'string', 'description' => 'Description of changes', ], ], 'required' => ['path', 'action'], ]; } public function handle(array $args, array $context = []): array { try { $path = $this->require($args, 'path'); $action = $this->require($args, 'action'); } catch (\InvalidArgumentException $e) { return $this->error($e->getMessage()); } $sessionId = $context['session_id'] ?? null; if (! $sessionId) { return $this->error('No active session. Call session_start first.'); } $session = AgentSession::where('session_id', $sessionId)->first(); if (! $session) { return $this->error('Session not found'); } $session->addArtifact( $path, $action, $this->optional($args, 'description') ); return $this->success(['artifact' => $path]); } }