orynacode-ai 1.16.17 → 1.16.19
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 +33 -0
- package/src/tool/registry.ts +0 -4
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,38 @@ 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
|
+
const failedCollab = assistantParts.find(
|
|
932
|
+
(p) => p.type === "tool" && (p as any).tool === "collab_reply" && (p as any).state?.status === "error",
|
|
933
|
+
) as any
|
|
934
|
+
const replyContent = failedCollab?.state?.input?.content || texts || "(collaboration task completed)"
|
|
935
|
+
sendReply(replyContent, collabMatch[1])
|
|
936
|
+
|
|
937
|
+
const collabTextPart = userParts.find(
|
|
938
|
+
(p) => p.type === "text" && (p as any).text?.includes("[Collaboration from"),
|
|
939
|
+
) as any
|
|
940
|
+
if (collabTextPart) {
|
|
941
|
+
yield* session.updatePart({
|
|
942
|
+
...collabTextPart,
|
|
943
|
+
text: collabTextPart.text.replace("]\n", "] ✓ Replied\n"),
|
|
944
|
+
})
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
|
|
916
949
|
ctx.assistantMessage.time.completed = Date.now()
|
|
917
950
|
yield* session.updateMessage(ctx.assistantMessage)
|
|
918
951
|
})
|
package/src/tool/registry.ts
CHANGED
|
@@ -13,7 +13,6 @@ import { WebFetchTool } from "./webfetch"
|
|
|
13
13
|
import { WriteTool } from "./write"
|
|
14
14
|
import { InvalidTool } from "./invalid"
|
|
15
15
|
import { SkillTool } from "./skill"
|
|
16
|
-
import { ReplyTool } from "./reply"
|
|
17
16
|
import * as Tool from "./tool"
|
|
18
17
|
import { Config } from "@/config/config"
|
|
19
18
|
import { type ToolContext as PluginToolContext, type ToolDefinition } from "@opencode-ai/plugin"
|
|
@@ -131,7 +130,6 @@ export const layer: Layer.Layer<
|
|
|
131
130
|
const edit = yield* EditTool
|
|
132
131
|
const greptool = yield* GrepTool
|
|
133
132
|
const skilltool = yield* SkillTool
|
|
134
|
-
const replytool = yield* ReplyTool
|
|
135
133
|
const patchtool = yield* ApplyPatchTool
|
|
136
134
|
const agent = yield* Agent.Service
|
|
137
135
|
|
|
@@ -240,7 +238,6 @@ export const layer: Layer.Layer<
|
|
|
240
238
|
question: Tool.init(question),
|
|
241
239
|
lsp: Tool.init(lsptool),
|
|
242
240
|
plan: Tool.init(plan),
|
|
243
|
-
collab_reply: Tool.init(replytool),
|
|
244
241
|
})
|
|
245
242
|
|
|
246
243
|
return {
|
|
@@ -260,7 +257,6 @@ export const layer: Layer.Layer<
|
|
|
260
257
|
tool.search,
|
|
261
258
|
tool.skill,
|
|
262
259
|
tool.patch,
|
|
263
|
-
tool.collab_reply,
|
|
264
260
|
...(flags.experimentalLspTool ? [tool.lsp] : []),
|
|
265
261
|
...(flags.experimentalPlanMode && flags.client === "cli" ? [tool.plan] : []),
|
|
266
262
|
],
|