chore: generate
This commit is contained in:
@@ -544,10 +544,7 @@ const part = (row: typeof PartTable.$inferSelect) =>
|
|||||||
}) as Part
|
}) as Part
|
||||||
|
|
||||||
const older = (row: Cursor) =>
|
const older = (row: Cursor) =>
|
||||||
or(
|
or(lt(MessageTable.time_created, row.time), and(eq(MessageTable.time_created, row.time), lt(MessageTable.id, row.id)))
|
||||||
lt(MessageTable.time_created, row.time),
|
|
||||||
and(eq(MessageTable.time_created, row.time), lt(MessageTable.id, row.id)),
|
|
||||||
)
|
|
||||||
|
|
||||||
function hydrate(rows: (typeof MessageTable.$inferSelect)[]) {
|
function hydrate(rows: (typeof MessageTable.$inferSelect)[]) {
|
||||||
const ids = rows.map((row) => row.id)
|
const ids = rows.map((row) => row.id)
|
||||||
@@ -930,11 +927,7 @@ export function filterCompacted(msgs: Iterable<WithParts>) {
|
|||||||
const completed = new Set<string>()
|
const completed = new Set<string>()
|
||||||
for (const msg of msgs) {
|
for (const msg of msgs) {
|
||||||
result.push(msg)
|
result.push(msg)
|
||||||
if (
|
if (msg.info.role === "user" && completed.has(msg.info.id) && msg.parts.some((part) => part.type === "compaction"))
|
||||||
msg.info.role === "user" &&
|
|
||||||
completed.has(msg.info.id) &&
|
|
||||||
msg.parts.some((part) => part.type === "compaction")
|
|
||||||
)
|
|
||||||
break
|
break
|
||||||
if (msg.info.role === "assistant" && msg.info.summary && msg.info.finish && !msg.info.error)
|
if (msg.info.role === "assistant" && msg.info.summary && msg.info.finish && !msg.info.error)
|
||||||
completed.add(msg.info.parentID)
|
completed.add(msg.info.parentID)
|
||||||
|
|||||||
@@ -1073,9 +1073,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
|||||||
let start = parseInt(range.start)
|
let start = parseInt(range.start)
|
||||||
let end = range.end ? parseInt(range.end) : undefined
|
let end = range.end ? parseInt(range.end) : undefined
|
||||||
if (start === end) {
|
if (start === end) {
|
||||||
const symbols = yield* lsp
|
const symbols = yield* lsp.documentSymbol(filePathURI).pipe(Effect.catch(() => Effect.succeed([])))
|
||||||
.documentSymbol(filePathURI)
|
|
||||||
.pipe(Effect.catch(() => Effect.succeed([])))
|
|
||||||
for (const symbol of symbols) {
|
for (const symbol of symbols) {
|
||||||
let r: LSP.Range | undefined
|
let r: LSP.Range | undefined
|
||||||
if ("range" in symbol) r = symbol.range
|
if ("range" in symbol) r = symbol.range
|
||||||
@@ -1453,9 +1451,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (step === 1)
|
if (step === 1)
|
||||||
yield* summary
|
yield* summary.summarize({ sessionID, messageID: lastUser.id }).pipe(Effect.ignore, Effect.forkIn(scope))
|
||||||
.summarize({ sessionID, messageID: lastUser.id })
|
|
||||||
.pipe(Effect.ignore, Effect.forkIn(scope))
|
|
||||||
|
|
||||||
if (step > 1 && lastFinished) {
|
if (step > 1 && lastFinished) {
|
||||||
for (const m of msgs) {
|
for (const m of msgs) {
|
||||||
@@ -1723,9 +1719,7 @@ export const PromptInput = z.object({
|
|||||||
tools: z
|
tools: z
|
||||||
.record(z.string(), z.boolean())
|
.record(z.string(), z.boolean())
|
||||||
.optional()
|
.optional()
|
||||||
.describe(
|
.describe("@deprecated tools and permissions have been merged, you can set permissions on the session itself now"),
|
||||||
"@deprecated tools and permissions have been merged, you can set permissions on the session itself now",
|
|
||||||
),
|
|
||||||
format: MessageV2.Format.optional(),
|
format: MessageV2.Format.optional(),
|
||||||
system: z.string().optional(),
|
system: z.string().optional(),
|
||||||
variant: z.string().optional(),
|
variant: z.string().optional(),
|
||||||
|
|||||||
@@ -79,9 +79,7 @@ export const layer = Layer.effect(
|
|||||||
const storage = yield* Storage.Service
|
const storage = yield* Storage.Service
|
||||||
const bus = yield* Bus.Service
|
const bus = yield* Bus.Service
|
||||||
|
|
||||||
const computeDiff = Effect.fn("SessionSummary.computeDiff")(function* (input: {
|
const computeDiff = Effect.fn("SessionSummary.computeDiff")(function* (input: { messages: MessageV2.WithParts[] }) {
|
||||||
messages: MessageV2.WithParts[]
|
|
||||||
}) {
|
|
||||||
let from: string | undefined
|
let from: string | undefined
|
||||||
let to: string | undefined
|
let to: string | undefined
|
||||||
for (const item of input.messages) {
|
for (const item of input.messages) {
|
||||||
|
|||||||
@@ -61,12 +61,7 @@ export const layer = Layer.effect(
|
|||||||
const get = Effect.fn("Todo.get")(function* (sessionID: SessionID) {
|
const get = Effect.fn("Todo.get")(function* (sessionID: SessionID) {
|
||||||
const rows = yield* Effect.sync(() =>
|
const rows = yield* Effect.sync(() =>
|
||||||
Database.use((db) =>
|
Database.use((db) =>
|
||||||
db
|
db.select().from(TodoTable).where(eq(TodoTable.session_id, sessionID)).orderBy(asc(TodoTable.position)).all(),
|
||||||
.select()
|
|
||||||
.from(TodoTable)
|
|
||||||
.where(eq(TodoTable.session_id, sessionID))
|
|
||||||
.orderBy(asc(TodoTable.position))
|
|
||||||
.all(),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
return rows.map((row) => ({
|
return rows.map((row) => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user