orynacode-ai 1.16.17 → 1.16.18
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/package.json +1 -1
- package/src/session/processor.ts +29 -0
- package/src/tool/registry.ts +0 -1
package/package.json
CHANGED
package/src/session/processor.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { Session } from "./session"
|
|
|
12
12
|
import { LLM } from "./llm"
|
|
13
13
|
import { MessageV2 } from "./message-v2"
|
|
14
14
|
import { isOverflow } from "./overflow"
|
|
15
|
+
import { sendReply } from "../oryna/reply-service"
|
|
15
16
|
import { PartID } from "./schema"
|
|
16
17
|
import type { SessionID } from "./schema"
|
|
17
18
|
import { SessionRetry } from "./retry"
|
|
@@ -913,6 +914,34 @@ export const layer = Layer.effect(
|
|
|
913
914
|
})
|
|
914
915
|
}
|
|
915
916
|
ctx.toolcalls = {}
|
|
917
|
+
|
|
918
|
+
const msgs = yield* session.messages({ sessionID: ctx.sessionID }).pipe(Effect.orDie)
|
|
919
|
+
const lastUser = msgs.findLast((m) => m.info.role === "user")
|
|
920
|
+
const collabMatch = (lastUser?.info as any)?.system?.match(/orynagate:from=(\S+)/)
|
|
921
|
+
if (collabMatch) {
|
|
922
|
+
const userParts = lastUser?.parts ?? []
|
|
923
|
+
const alreadyReplied = userParts.some((p) => p.type === "text" && (p as any).text?.includes("✓ Replied"))
|
|
924
|
+
if (!alreadyReplied) {
|
|
925
|
+
const assistantParts = msgs.findLast((m) => m.info.role === "assistant")?.parts ?? []
|
|
926
|
+
const texts = assistantParts
|
|
927
|
+
.filter((p) => p.type === "text")
|
|
928
|
+
.map((p: any) => p.text)
|
|
929
|
+
.join("")
|
|
930
|
+
.trim()
|
|
931
|
+
sendReply(texts || "(collaboration task completed)", collabMatch[1])
|
|
932
|
+
|
|
933
|
+
const collabTextPart = userParts.find(
|
|
934
|
+
(p) => p.type === "text" && (p as any).text?.includes("[Collaboration from"),
|
|
935
|
+
) as any
|
|
936
|
+
if (collabTextPart) {
|
|
937
|
+
yield* session.updatePart({
|
|
938
|
+
...collabTextPart,
|
|
939
|
+
text: collabTextPart.text.replace("]\n", "] ✓ Replied\n"),
|
|
940
|
+
})
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
|
|
916
945
|
ctx.assistantMessage.time.completed = Date.now()
|
|
917
946
|
yield* session.updateMessage(ctx.assistantMessage)
|
|
918
947
|
})
|
package/src/tool/registry.ts
CHANGED