@onklave/agent-cli 0.1.43 → 0.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.js +17 -5
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -577,10 +577,19 @@ var PlatformClient = class {
|
|
|
577
577
|
* Create a new agent session on the platform.
|
|
578
578
|
*/
|
|
579
579
|
async spawnSession(config) {
|
|
580
|
+
const body = {
|
|
581
|
+
task: config.task,
|
|
582
|
+
context: config.context,
|
|
583
|
+
model: config.model,
|
|
584
|
+
timeout: config.timeout
|
|
585
|
+
};
|
|
586
|
+
if (config.persona) body.personaName = config.persona;
|
|
587
|
+
if (config.workflow) body.workflowName = config.workflow;
|
|
588
|
+
if (config.machineId) body.machineId = config.machineId;
|
|
580
589
|
return this.request(
|
|
581
590
|
"POST",
|
|
582
591
|
"/api/v1/agent/spawn",
|
|
583
|
-
|
|
592
|
+
body
|
|
584
593
|
);
|
|
585
594
|
}
|
|
586
595
|
/*
|
|
@@ -659,7 +668,7 @@ var PlatformClient = class {
|
|
|
659
668
|
async registerMachine(linkingToken, metadata) {
|
|
660
669
|
return this.request("POST", "/api/v1/runner/register", {
|
|
661
670
|
linkingToken,
|
|
662
|
-
metadata
|
|
671
|
+
...metadata
|
|
663
672
|
});
|
|
664
673
|
}
|
|
665
674
|
/*
|
|
@@ -695,10 +704,13 @@ var PlatformClient = class {
|
|
|
695
704
|
);
|
|
696
705
|
}
|
|
697
706
|
/*
|
|
698
|
-
* Unregister this machine.
|
|
707
|
+
* Unregister this machine. The backend exposes this as DELETE on the
|
|
708
|
+
* register route and identifies the machine via the `x-machine-id` header.
|
|
699
709
|
*/
|
|
700
|
-
async unregisterMachine() {
|
|
701
|
-
await this.request("
|
|
710
|
+
async unregisterMachine(machineId) {
|
|
711
|
+
await this.request("DELETE", "/api/v1/runner/register", void 0, {
|
|
712
|
+
"x-machine-id": machineId
|
|
713
|
+
});
|
|
702
714
|
}
|
|
703
715
|
/*
|
|
704
716
|
* Update an already-registered machine's configuration. Used by
|