orynacode-ai 1.16.18 → 1.16.20

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "1.16.18",
3
+ "version": "1.16.20",
4
4
  "name": "orynacode-ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -6,11 +6,22 @@ import path from "path"
6
6
  export function getOrynaGateId(dir: string): string {
7
7
  try {
8
8
  const config = JSON.parse(readFileSync(path.join(dir, ".orynagate"), "utf-8"))
9
+ if (config.ticket) return config.ticket
9
10
  if (config.id && typeof config.id === "string") return config.id
10
11
  } catch {}
11
12
  return path.basename(dir)
12
13
  }
13
14
 
15
+ export function getOrynaGateKey(dir: string): string {
16
+ const user = os.userInfo().username || "user"
17
+ try {
18
+ const config = JSON.parse(readFileSync(path.join(dir, ".orynagate"), "utf-8"))
19
+ if (config.ticket) return `sk-ticket-${user}-${config.ticket}`
20
+ if (config.id && typeof config.id === "string") return `sk-local-${user}-${config.id}`
21
+ } catch {}
22
+ return `sk-local-${user}-${path.basename(dir)}`
23
+ }
24
+
14
25
  export function setReady(ready: boolean) {
15
26
  const s = agentStatus()
16
27
  setAgentStatus({ ...s, ready })
@@ -67,8 +78,7 @@ export function start() {
67
78
  if (!url) return
68
79
 
69
80
  const host = new URL(url).host
70
- const user = os.userInfo().username || "user"
71
- const token = `sk-local-${user}-${path.basename(process.env.ORYNA_GATE_WORKSPACE || process.cwd())}`
81
+ const token = getOrynaGateKey(process.env.ORYNA_GATE_WORKSPACE || process.cwd())
72
82
  const wsUrl = `ws://${host}/ws?token=${token}&name=orynacode`
73
83
 
74
84
  const connect = () => {
@@ -7,7 +7,7 @@ import { NoSuchModelError, type Provider as SDK } from "ai"
7
7
  import { Log } from "@opencode-ai/core/util/log"
8
8
  import { Npm } from "@opencode-ai/core/npm"
9
9
  import { Hash } from "@opencode-ai/core/util/hash"
10
- import { getOrynaGateId } from "../oryna/agent"
10
+ import { getOrynaGateKey } from "../oryna/agent"
11
11
  import { Plugin } from "../plugin"
12
12
  import { serviceUse } from "@opencode-ai/core/effect/service-use"
13
13
  import { type LanguageModelV3 } from "@ai-sdk/provider"
@@ -1688,9 +1688,7 @@ export const layer = Layer.effect(
1688
1688
  if (baseURL !== undefined) options["baseURL"] = baseURL
1689
1689
  if (options["apiKey"] === undefined && provider.key) options["apiKey"] = provider.key
1690
1690
  if (model.providerID === "orynagate") {
1691
- const id = getOrynaGateId(process.cwd())
1692
- const user = os.userInfo().username || "user"
1693
- options["apiKey"] = `sk-local-${user}-${id}`
1691
+ options["apiKey"] = getOrynaGateKey(process.env.ORYNA_GATE_WORKSPACE || process.cwd())
1694
1692
  }
1695
1693
  if (model.headers)
1696
1694
  options["headers"] = {
@@ -928,7 +928,11 @@ export const layer = Layer.effect(
928
928
  .map((p: any) => p.text)
929
929
  .join("")
930
930
  .trim()
931
- sendReply(texts || "(collaboration task completed)", collabMatch[1])
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])
932
936
 
933
937
  const collabTextPart = userParts.find(
934
938
  (p) => p.type === "text" && (p as any).text?.includes("[Collaboration from"),
@@ -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 {