summaryrefslogtreecommitdiff
path: root/src/marlin.agents.shell/Program.cs
diff options
context:
space:
mode:
authorMelodi <62381002+Melodi17@users.noreply.github.com>2026-10-27 23:04:59 +1000
committerMelodi <62381002+Melodi17@users.noreply.github.com>2026-10-27 23:04:59 +1000
commitecd5f5d13936dd097b12766cb95a568ad5b073a9 (patch)
treef360b08e656a98faca4f2b9f10dc44602e6ca289 /src/marlin.agents.shell/Program.cs
parent88ee626cb3686dc176cd7911b073c4e65fa54d34 (diff)
feat: lots of stuff
Diffstat (limited to 'src/marlin.agents.shell/Program.cs')
-rw-r--r--src/marlin.agents.shell/Program.cs27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/marlin.agents.shell/Program.cs b/src/marlin.agents.shell/Program.cs
index 02a0bc9..75ea8ad 100644
--- a/src/marlin.agents.shell/Program.cs
+++ b/src/marlin.agents.shell/Program.cs
@@ -1,9 +1,20 @@
using System.Runtime.InteropServices;
+using System.Threading.Channels;
+using Grpc.Net.Client;
using marlin.agents.shell;
+using marlin.core.contracts;
+using marlin.core.functional;
using marlin.core.models;
+using marlin.core.models.meta;
+using marlin.core.models.plan;
+using marlin.core.util;
+using ProtoBuf.Grpc.Client;
DotNetEnv.Env.NoClobber().TraversePath().Load();
+var jobInstanceDir = Path.Combine(CommonPaths.AgentRoot, "instance");
+Directory.CreateDirectory(jobInstanceDir);
+
var client = MarlinApiClient.FromEnvironment();
var capabilities = new CapabilitySet();
@@ -16,5 +27,17 @@ AgentConfiguration config = await client.Handshake(status);
Console.WriteLine($"IAM: {config.Name}");
Console.WriteLine($"MCJ: {config.MaxConcurrentJobs}");
-var job = await client.QueueNextJob();
-Console.WriteLine(job == null ? "No pending jobs." : $"Claimed job {job.Id}: {job.Recipe}");
+while (true)
+{
+ var job = await client.QueueNextJob();
+ Console.WriteLine(job == null ? "No pending jobs." : $"Claimed job {job.Id}: {job.Recipe}");
+
+ if (job != null)
+ {
+ GitBinaryClient gitClient = new();
+ var uow = new JobUnitOfWork(job, client, gitClient);
+ await uow.Run();
+ }
+
+ await Task.Delay(TimeSpan.FromSeconds(5));
+} \ No newline at end of file