orynacode-ai 1.16.10 → 1.16.12

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.10",
3
+ "version": "1.16.12",
4
4
  "name": "orynacode-ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -3,6 +3,14 @@ import { setAgentStatus, agentStatus } from "./agent-signal"
3
3
  import os from "os"
4
4
  import path from "path"
5
5
 
6
+ export function getOrynaGateId(dir: string): string {
7
+ try {
8
+ const config = JSON.parse(readFileSync(path.join(dir, ".orynagate"), "utf-8"))
9
+ if (config.id && typeof config.id === "string") return config.id
10
+ } catch {}
11
+ return path.basename(dir)
12
+ }
13
+
6
14
  export function setReady(ready: boolean) {
7
15
  const s = agentStatus()
8
16
  setAgentStatus({ ...s, ready })
@@ -60,7 +68,7 @@ export function start() {
60
68
 
61
69
  const host = new URL(url).host
62
70
  const user = os.userInfo().username || "user"
63
- const token = `sk-local-${user}-${path.basename(process.cwd())}`
71
+ const token = `sk-local-${user}-${path.basename(process.env.ORYNA_GATE_WORKSPACE || process.cwd())}`
64
72
  const wsUrl = `ws://${host}/ws?token=${token}&name=orynacode`
65
73
 
66
74
  const connect = () => {
@@ -1521,9 +1521,9 @@ export const layer = Layer.effect(
1521
1521
  toPublicInfo(dbInfo),
1522
1522
  ),
1523
1523
  )
1524
- const opts = options ?? {}
1525
- const patch: Partial<Info> = providers[providerID] ? { options: opts } : { source: "custom", options: opts }
1526
- mergeProvider(providerID, patch)
1524
+ const opts = options ?? {}
1525
+ const patch: Partial<Info> = providers[providerID] ? { options: opts } : { source: "custom", options: opts }
1526
+ mergeProvider(providerID, patch)
1527
1527
  }
1528
1528
 
1529
1529
  for (const [id, fn] of Object.entries(custom(dep))) {
@@ -1686,6 +1686,11 @@ export const layer = Layer.effect(
1686
1686
 
1687
1687
  if (baseURL !== undefined) options["baseURL"] = baseURL
1688
1688
  if (options["apiKey"] === undefined && provider.key) options["apiKey"] = provider.key
1689
+ if (model.providerID === "orynagate") {
1690
+ const workspace = path.basename(process.env.ORYNA_GATE_WORKSPACE || process.cwd())
1691
+ const user = os.userInfo().username || "user"
1692
+ options["apiKey"] = `sk-local-${user}-${workspace}`
1693
+ }
1689
1694
  if (model.headers)
1690
1695
  options["headers"] = {
1691
1696
  ...options["headers"],