Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

819 B
Raw Blame
import { lstatSync } from 'node:fs'
import { nodeFileContentsEqualSync } from './node-file-content-equality'

// OpenCode 2 reloads this and subsequent plugins on mtime changes even for identical bytes; skip current writes.
// Follow canonical symlinks because OpenCode loads through them.
export function isInstalledOpenCodePluginCurrent(pluginPath: string, source: string): boolean {
  try {
    return nodeFileContentsEqualSync(pluginPath, source)
  } catch {
    return false
  }
}

// Overlay variant: a symlink there mirrors a user entry, never Orca's file, even when the bytes match.
export function isOverlayOpenCodePluginCurrent(pluginPath: string, source: string): boolean {
  try {
    return lstatSync(pluginPath).isFile() && nodeFileContentsEqualSync(pluginPath, source)
  } catch {
    return false
  }
}