@rowan-agent/agent 0.7.3 → 0.7.5
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/dist/index.js +15 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4346,21 +4346,25 @@ var InMemoryStore = class _InMemoryStore {
|
|
|
4346
4346
|
this.assertExecution(run, input.execution, input.expectedRevision);
|
|
4347
4347
|
this.assertState(run, ["running"]);
|
|
4348
4348
|
this.assertNoOpenTools(run);
|
|
4349
|
+
const prompt = {
|
|
4350
|
+
...clone(input.prompt),
|
|
4351
|
+
sequenceWithinRun: this.nextMessageSequence(run.id)
|
|
4352
|
+
};
|
|
4349
4353
|
const request = {
|
|
4350
4354
|
id: requestId,
|
|
4351
|
-
messageId:
|
|
4355
|
+
messageId: prompt.id,
|
|
4352
4356
|
createdAt: createTimestamp()
|
|
4353
4357
|
};
|
|
4354
|
-
this.messages.set(
|
|
4358
|
+
this.messages.set(prompt.id, prompt);
|
|
4355
4359
|
run.state = "input_required";
|
|
4356
4360
|
run.checkpoint = clone(input.checkpoint);
|
|
4357
4361
|
run.openInputRequest = request;
|
|
4358
4362
|
delete run.execution;
|
|
4359
4363
|
run.revision += 1;
|
|
4360
4364
|
run.updatedAt = createTimestamp();
|
|
4361
|
-
this.appendMessage(run,
|
|
4362
|
-
this.appendTransition(run, "running", "input_required", request,
|
|
4363
|
-
const result = { run: clone(run), prompt: clone(
|
|
4365
|
+
this.appendMessage(run, prompt);
|
|
4366
|
+
this.appendTransition(run, "running", "input_required", request, prompt);
|
|
4367
|
+
const result = { run: clone(run), prompt: clone(prompt), request: clone(request) };
|
|
4364
4368
|
this.writeOperationReceipt(operationKey, operationPayload, result);
|
|
4365
4369
|
return result;
|
|
4366
4370
|
}
|
|
@@ -4547,9 +4551,10 @@ var InMemoryStore = class _InMemoryStore {
|
|
|
4547
4551
|
const nextState = input.failure ? "failed" : "completed";
|
|
4548
4552
|
if (nextState === "completed" && !input.outcome) throw new TypeError("completed Run requires an outcome");
|
|
4549
4553
|
if (nextState === "failed" && !input.failure) throw new TypeError("failed Run requires a failure");
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
this.
|
|
4554
|
+
const output = input.output ? { ...clone(input.output), sequenceWithinRun: this.nextMessageSequence(run.id) } : void 0;
|
|
4555
|
+
if (output) {
|
|
4556
|
+
this.messages.set(output.id, output);
|
|
4557
|
+
this.appendMessage(run, output);
|
|
4553
4558
|
}
|
|
4554
4559
|
run.state = nextState;
|
|
4555
4560
|
if (input.outcome) run.outcome = clone(input.outcome);
|
|
@@ -4557,7 +4562,7 @@ var InMemoryStore = class _InMemoryStore {
|
|
|
4557
4562
|
delete run.execution;
|
|
4558
4563
|
run.revision += 1;
|
|
4559
4564
|
run.updatedAt = createTimestamp();
|
|
4560
|
-
this.appendTransition(run, "running", nextState, void 0,
|
|
4565
|
+
this.appendTransition(run, "running", nextState, void 0, output, input.outcome, input.failure);
|
|
4561
4566
|
const result = clone(run);
|
|
4562
4567
|
this.writeOperationReceipt(operationKey, operationPayload, result);
|
|
4563
4568
|
return result;
|
|
@@ -4809,6 +4814,7 @@ var InMemoryStore = class _InMemoryStore {
|
|
|
4809
4814
|
agentId: run.agentId,
|
|
4810
4815
|
runId: run.id,
|
|
4811
4816
|
runRevision: run.revision,
|
|
4817
|
+
...run.metadata ? { metadata: clone(run.metadata) } : {},
|
|
4812
4818
|
createdAt: createTimestamp(),
|
|
4813
4819
|
...extra
|
|
4814
4820
|
};
|