-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.php
More file actions
23 lines (20 loc) · 803 Bytes
/
main.php
File metadata and controls
23 lines (20 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
declare(strict_types=1);
/**
* @return list<array{type: string, payload: array<string, mixed>}>
*/
function streamJobEvents(): array
{
return [
['type' => 'job.started', 'payload' => ['phase' => 'start']],
['type' => 'log', 'payload' => ['level' => 'info', 'message' => 'planning']],
['type' => 'thought', 'payload' => ['text' => 'choose tool']],
['type' => 'metric', 'payload' => ['name' => 'cost.usd', 'value' => 0.03, 'unit' => 'USD']],
['type' => 'tool.result', 'payload' => ['tool' => 'search', 'ok' => true]],
['type' => 'artifact.ref', 'payload' => ['uri' => 'art_report']],
['type' => 'job.completed', 'payload' => ['value' => 'done']],
];
}
foreach (streamJobEvents() as $event) {
printf("%s\n", $event['type']);
}