chore: generate
This commit is contained in:
@@ -125,10 +125,19 @@ describe("session-entry-stepper", () => {
|
|||||||
|
|
||||||
SessionEntryStepper.stepWith(adapterFor(store), SessionEvent.Prompt.create({ text: "hello", timestamp: time(1) }))
|
SessionEntryStepper.stepWith(adapterFor(store), SessionEvent.Prompt.create({ text: "hello", timestamp: time(1) }))
|
||||||
SessionEntryStepper.stepWith(adapterFor(store), SessionEvent.Reasoning.Started.create({ timestamp: time(2) }))
|
SessionEntryStepper.stepWith(adapterFor(store), SessionEvent.Reasoning.Started.create({ timestamp: time(2) }))
|
||||||
SessionEntryStepper.stepWith(adapterFor(store), SessionEvent.Reasoning.Delta.create({ delta: "thinking", timestamp: time(3) }))
|
SessionEntryStepper.stepWith(
|
||||||
SessionEntryStepper.stepWith(adapterFor(store), SessionEvent.Reasoning.Ended.create({ text: "thought", timestamp: time(4) }))
|
adapterFor(store),
|
||||||
|
SessionEvent.Reasoning.Delta.create({ delta: "thinking", timestamp: time(3) }),
|
||||||
|
)
|
||||||
|
SessionEntryStepper.stepWith(
|
||||||
|
adapterFor(store),
|
||||||
|
SessionEvent.Reasoning.Ended.create({ text: "thought", timestamp: time(4) }),
|
||||||
|
)
|
||||||
SessionEntryStepper.stepWith(adapterFor(store), SessionEvent.Text.Started.create({ timestamp: time(5) }))
|
SessionEntryStepper.stepWith(adapterFor(store), SessionEvent.Text.Started.create({ timestamp: time(5) }))
|
||||||
SessionEntryStepper.stepWith(adapterFor(store), SessionEvent.Text.Delta.create({ delta: "world", timestamp: time(6) }))
|
SessionEntryStepper.stepWith(
|
||||||
|
adapterFor(store),
|
||||||
|
SessionEvent.Text.Delta.create({ delta: "world", timestamp: time(6) }),
|
||||||
|
)
|
||||||
SessionEntryStepper.stepWith(
|
SessionEntryStepper.stepWith(
|
||||||
adapterFor(store),
|
adapterFor(store),
|
||||||
SessionEvent.Step.Ended.create({
|
SessionEvent.Step.Ended.create({
|
||||||
@@ -192,7 +201,9 @@ describe("session-entry-stepper", () => {
|
|||||||
test("appends committed and pending entries", () => {
|
test("appends committed and pending entries", () => {
|
||||||
const state = memoryState()
|
const state = memoryState()
|
||||||
const adapter = SessionEntryStepper.memory(state)
|
const adapter = SessionEntryStepper.memory(state)
|
||||||
const committed = SessionEntry.User.fromEvent(SessionEvent.Prompt.create({ text: "committed", timestamp: time(1) }))
|
const committed = SessionEntry.User.fromEvent(
|
||||||
|
SessionEvent.Prompt.create({ text: "committed", timestamp: time(1) }),
|
||||||
|
)
|
||||||
const pending = SessionEntry.User.fromEvent(SessionEvent.Prompt.create({ text: "pending", timestamp: time(2) }))
|
const pending = SessionEntry.User.fromEvent(SessionEvent.Prompt.create({ text: "pending", timestamp: time(2) }))
|
||||||
|
|
||||||
adapter.appendEntry(committed)
|
adapter.appendEntry(committed)
|
||||||
@@ -205,8 +216,14 @@ describe("session-entry-stepper", () => {
|
|||||||
test("stepWith through memory records reasoning", () => {
|
test("stepWith through memory records reasoning", () => {
|
||||||
const state = active()
|
const state = active()
|
||||||
|
|
||||||
SessionEntryStepper.stepWith(SessionEntryStepper.memory(state), SessionEvent.Reasoning.Started.create({ timestamp: time(1) }))
|
SessionEntryStepper.stepWith(
|
||||||
SessionEntryStepper.stepWith(SessionEntryStepper.memory(state), SessionEvent.Reasoning.Delta.create({ delta: "draft", timestamp: time(2) }))
|
SessionEntryStepper.memory(state),
|
||||||
|
SessionEvent.Reasoning.Started.create({ timestamp: time(1) }),
|
||||||
|
)
|
||||||
|
SessionEntryStepper.stepWith(
|
||||||
|
SessionEntryStepper.memory(state),
|
||||||
|
SessionEvent.Reasoning.Delta.create({ delta: "draft", timestamp: time(2) }),
|
||||||
|
)
|
||||||
SessionEntryStepper.stepWith(
|
SessionEntryStepper.stepWith(
|
||||||
SessionEntryStepper.memory(state),
|
SessionEntryStepper.memory(state),
|
||||||
SessionEvent.Reasoning.Ended.create({ text: "final", timestamp: time(3) }),
|
SessionEvent.Reasoning.Ended.create({ text: "final", timestamp: time(3) }),
|
||||||
@@ -221,7 +238,10 @@ describe("session-entry-stepper", () => {
|
|||||||
test("stores prompts in entries when no assistant is pending", () => {
|
test("stores prompts in entries when no assistant is pending", () => {
|
||||||
FastCheck.assert(
|
FastCheck.assert(
|
||||||
FastCheck.property(word, (body) => {
|
FastCheck.property(word, (body) => {
|
||||||
const next = SessionEntryStepper.step(memoryState(), SessionEvent.Prompt.create({ text: body, timestamp: time(1) }))
|
const next = SessionEntryStepper.step(
|
||||||
|
memoryState(),
|
||||||
|
SessionEvent.Prompt.create({ text: body, timestamp: time(1) }),
|
||||||
|
)
|
||||||
expect(next.entries).toHaveLength(1)
|
expect(next.entries).toHaveLength(1)
|
||||||
expect(next.entries[0]?.type).toBe("user")
|
expect(next.entries[0]?.type).toBe("user")
|
||||||
if (next.entries[0]?.type !== "user") return
|
if (next.entries[0]?.type !== "user") return
|
||||||
@@ -234,7 +254,10 @@ describe("session-entry-stepper", () => {
|
|||||||
test("stores prompts in pending when an assistant is pending", () => {
|
test("stores prompts in pending when an assistant is pending", () => {
|
||||||
FastCheck.assert(
|
FastCheck.assert(
|
||||||
FastCheck.property(word, (body) => {
|
FastCheck.property(word, (body) => {
|
||||||
const next = SessionEntryStepper.step(active(), SessionEvent.Prompt.create({ text: body, timestamp: time(1) }))
|
const next = SessionEntryStepper.step(
|
||||||
|
active(),
|
||||||
|
SessionEvent.Prompt.create({ text: body, timestamp: time(1) }),
|
||||||
|
)
|
||||||
expect(next.pending).toHaveLength(1)
|
expect(next.pending).toHaveLength(1)
|
||||||
expect(next.pending[0]?.type).toBe("user")
|
expect(next.pending[0]?.type).toBe("user")
|
||||||
if (next.pending[0]?.type !== "user") return
|
if (next.pending[0]?.type !== "user") return
|
||||||
@@ -249,7 +272,10 @@ describe("session-entry-stepper", () => {
|
|||||||
FastCheck.property(texts, (parts) => {
|
FastCheck.property(texts, (parts) => {
|
||||||
const next = parts.reduce(
|
const next = parts.reduce(
|
||||||
(state, part, i) =>
|
(state, part, i) =>
|
||||||
SessionEntryStepper.step(state, SessionEvent.Text.Delta.create({ delta: part, timestamp: time(i + 2) })),
|
SessionEntryStepper.step(
|
||||||
|
state,
|
||||||
|
SessionEvent.Text.Delta.create({ delta: part, timestamp: time(i + 2) }),
|
||||||
|
),
|
||||||
SessionEntryStepper.step(active(), SessionEvent.Text.Started.create({ timestamp: time(1) })),
|
SessionEntryStepper.step(active(), SessionEvent.Text.Started.create({ timestamp: time(1) })),
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -790,7 +816,10 @@ describe("session-entry-stepper", () => {
|
|||||||
test("records synthetic events", () => {
|
test("records synthetic events", () => {
|
||||||
FastCheck.assert(
|
FastCheck.assert(
|
||||||
FastCheck.property(word, (body) => {
|
FastCheck.property(word, (body) => {
|
||||||
const next = SessionEntryStepper.step(memoryState(), SessionEvent.Synthetic.create({ text: body, timestamp: time(1) }))
|
const next = SessionEntryStepper.step(
|
||||||
|
memoryState(),
|
||||||
|
SessionEvent.Synthetic.create({ text: body, timestamp: time(1) }),
|
||||||
|
)
|
||||||
expect(next.entries).toHaveLength(1)
|
expect(next.entries).toHaveLength(1)
|
||||||
expect(next.entries[0]?.type).toBe("synthetic")
|
expect(next.entries[0]?.type).toBe("synthetic")
|
||||||
if (next.entries[0]?.type !== "synthetic") return
|
if (next.entries[0]?.type !== "synthetic") return
|
||||||
|
|||||||
Reference in New Issue
Block a user