comparison infinite_canvas/agent_service_test.c @ 280:49e9e591c9bb

Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
author MrJuneJune <me@mrjunejune.com>
date Tue, 18 Aug 2026 19:14:53 -0700
parents
children
comparison
equal deleted inserted replaced
279:b3b547563ec7 280:49e9e591c9bb
1 #include "infinite_canvas/agent_service.h"
2
3 #include <assert.h>
4 #include <stdlib.h>
5 #include <string.h>
6 #include <unistd.h>
7
8 int main(int argc, char **p_argv)
9 {
10 assert(argc == 2);
11 assert(setenv(
12 "INFINITE_CANVAS_COPILOT_SIDECAR_PATH",
13 p_argv[1],
14 1) == 0);
15 assert(setenv(
16 "INFINITE_CANVAS_COPILOT_CLI_PATH",
17 p_argv[1],
18 1) == 0);
19
20 Dowa_Arena *p_arena = Dowa_Arena_Create(ONE_MEGA_BYTE);
21 assert(p_arena);
22 Canvas_Agent_Service service;
23 assert(Canvas_Agent_Service_Init(&service, p_arena));
24 assert(Canvas_Agent_Service_Submit(
25 &service,
26 "Create a rendering session",
27 "entity id=42 type=Agent conversation"));
28
29 Canvas_Agent_Status status = CANVAS_AGENT_WORKING;
30 char response[CANVAS_AGENT_RESPONSE_CAPACITY] = {0};
31 char error[512] = {0};
32 for (int32 attempt = 0;
33 attempt < 200 && status == CANVAS_AGENT_WORKING;
34 attempt++) {
35 usleep(10000);
36 status = Canvas_Agent_Service_Poll(
37 &service,
38 response,
39 sizeof(response),
40 error,
41 sizeof(error));
42 }
43 assert(status == CANVAS_AGENT_READY);
44 assert(strstr(response, "hello traveler"));
45
46 Canvas_Agent_Service_Shutdown(&service);
47 Dowa_Arena_Free(p_arena);
48 return 0;
49 }