vgxness 1.3.1 → 1.4.0
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.
|
@@ -37,7 +37,8 @@ export class AgentActivationService {
|
|
|
37
37
|
});
|
|
38
38
|
if (!run.ok)
|
|
39
39
|
return run;
|
|
40
|
-
const
|
|
40
|
+
const payloadMode = resolvePayloadMode(validated.value);
|
|
41
|
+
const payload = this.dependencies.opencodeManagerPayload.build(toPayloadInput(validated.value, agent.value.id, payloadMode));
|
|
41
42
|
if (!payload.ok)
|
|
42
43
|
return this.failAfterRun(run.value.id, payload.error.code, payload.error.message);
|
|
43
44
|
const verboseEnvelopeWithoutRun = {
|
|
@@ -56,11 +57,11 @@ export class AgentActivationService {
|
|
|
56
57
|
...payload.value.warnings,
|
|
57
58
|
],
|
|
58
59
|
};
|
|
59
|
-
const envelopeWithoutRun =
|
|
60
|
+
const envelopeWithoutRun = payloadMode === 'compact' ? compactActivationEnvelope(verboseEnvelopeWithoutRun, validated.value) : verboseEnvelopeWithoutRun;
|
|
60
61
|
const checkpoint = this.dependencies.runs.appendCheckpoint({
|
|
61
62
|
runId: run.value.id,
|
|
62
63
|
label: 'agent-activation-initial',
|
|
63
|
-
state: toJson(checkpointState(envelopeWithoutRun, run.value.id,
|
|
64
|
+
state: toJson(checkpointState(envelopeWithoutRun, run.value.id, payloadMode)),
|
|
64
65
|
});
|
|
65
66
|
if (!checkpoint.ok)
|
|
66
67
|
return this.failAfterRun(run.value.id, checkpoint.error.code, checkpoint.error.message);
|
|
@@ -138,7 +139,10 @@ function validateActivationInput(input) {
|
|
|
138
139
|
validated.payloadMode = input.payloadMode;
|
|
139
140
|
return ok(validated);
|
|
140
141
|
}
|
|
141
|
-
function
|
|
142
|
+
function resolvePayloadMode(input) {
|
|
143
|
+
return input.payloadMode ?? 'compact';
|
|
144
|
+
}
|
|
145
|
+
function toPayloadInput(input, agentId, payloadMode) {
|
|
142
146
|
const payload = { project: input.project, scope: input.scope };
|
|
143
147
|
if (input.agentId !== undefined)
|
|
144
148
|
payload.agentId = agentId;
|
|
@@ -148,7 +152,7 @@ function toPayloadInput(input, agentId) {
|
|
|
148
152
|
payload.workspaceRoot = input.workspaceRoot;
|
|
149
153
|
if (input.maxSourceBytes !== undefined)
|
|
150
154
|
payload.maxSourceBytes = input.maxSourceBytes;
|
|
151
|
-
payload.payloadMode =
|
|
155
|
+
payload.payloadMode = payloadMode;
|
|
152
156
|
return payload;
|
|
153
157
|
}
|
|
154
158
|
function checkpointState(envelopeWithoutRun, runId, mode) {
|