Skip to content

armgit / Orkas

Public Imported from GitHub
0

Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.

Fix OrkasOpen startup module resolution

wyt658c2dd7e639
diff --git a/src/main/features/config.ts b/src/main/features/config.ts
index 99490ccd..3caace98 100644
--- a/src/main/features/config.ts
+++ b/src/main/features/config.ts
@@ -45,6 +45,10 @@ export interface UserPreferences {
* `ORKAS_METACOGNITION='0'` remains a higher-priority kill switch.
* Reads go through `features/metacognition.isFeatureEnabled`. */
metacognition_enabled?: boolean;
+ /** Whether machine-global skill roots such as ~/.codex/skills are visible
+ * to commander open-tier skill search. Missing means enabled, preserving
+ * the historical OrkasOpen behavior. */
+ global_skill_roots_enabled?: boolean;
/** Per-field update clocks used by cloud-sync to merge independent
* preference changes without treating the whole JSON file as one blob. */
_field_updated_at?: Record<string, number>;
@@ -106,7 +110,16 @@ export type AppConfig = UserPreferences;
export function getLanguage(): Lang {
const v = readPreferences().language;
- return isLang(v) ? v : systemLanguage();
+ const lang = isLang(v) ? v : systemLanguage();
+ setCurrentLang(lang);
+ return lang;
+}
+
+export function getLanguageForUser(uid: string): Lang {
+ const v = readJsonSync<UserPreferences>(userPreferencesFile(uid)).language;
+ const lang = isLang(v) ? v : systemLanguage();
+ setCurrentLang(lang);
+ return lang;
}
export function setLanguage(lang: Lang): Lang {
@@ -179,6 +192,15 @@ export function setMetacognitionEnabled(enabled: boolean): boolean {
return !!enabled;
}
+export function getGlobalSkillRootsEnabled(): boolean {
+ return readPreferences().global_skill_roots_enabled !== false;
+}
+
+export function setGlobalSkillRootsEnabled(enabled: boolean): boolean {
+ writePreferences({ global_skill_roots_enabled: !!enabled });
+ return !!enabled;
+}
+
/** Production wrapper: reads the system locale from Electron's `app`. */
export function initLanguageFromApp(): Lang {
diff --git a/src/main/features/group_chat/bus.ts b/src/main/features/group_chat/bus.ts
index 2ee59a49..23ef6164 100644
--- a/src/main/features/group_chat/bus.ts
+++ b/src/main/features/group_chat/bus.ts
@@ -1584,15 +1584,8 @@ async function runTurn(state: CidState, w: WorkerState, item: QueueItem): Promis
let workingText = finalText || '';
if (turnSyncConflictResolution.length && workingText && !errText && !aborted) {
const results = extractSyncConflictResults(workingText);
- const allowedIds = new Set(turnSyncConflictResolution.map((item) => item.id));
- try {
- const syncFeature = await import('../sync');
- for (const result of results) {
- if (!allowedIds.has(result.conflictId)) continue;
- await syncFeature.completeConflictResolutionResult(uid, result);
- }
- } catch (err) {
- log.warn(`sync conflict result apply failed cid=${cid}: ${(err as Error).message}`);
+ if (results.length) {
+ log.warn(`sync conflict result ignored in OrkasOpen cid=${cid}: sync feature is stripped`);
}
}
diff --git a/src/main/index.ts b/src/main/index.ts
index 340bdbef..c518cc93 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -10,7 +10,7 @@
* single path — the old dev/prod data-root split is gone. The side
* effect lives at module load (not in body code) because esbuild's
* CJS transformer hoists imports — `paths.ts` would otherwise load
- * with an unset env var. See install-data-root.ts header.
+ * with an unset env var. See install-data-root.cjs header.
* 2. Pin CORE_AGENT_AUTH_DIR to <WS_ROOT>/config/ so core-agent's
* credential store lives under data/ (local-only, never synced).
* The env var name is core-agent's public API — kept as
@@ -35,10 +35,10 @@ import { app, BrowserWindow, Menu, ipcMain, nativeImage, protocol, session, shel
// container, runs the one-shot PC/data → <container>/data migration, and
// sets process.env.ORKAS_WORKSPACE_ROOT. Must be the FIRST project import
// — any module loaded before this would not see the env var. See
-// install-data-root.ts header for why the side effect lives at load time
+// install-data-root.cjs header for why the side effect lives at load time
// rather than in index.ts body (esbuild CJS hoists imports → body runs
// after paths.ts loads, which is too late to set the env var).
-import './install-data-root';
+import './install-data-root.cjs';
const APP_USER_MODEL_ID = 'com.orkas.desktop';
@@ -105,7 +105,7 @@ const log = createLogger('orkas');
// Replay any pin / migration warnings buffered by install-data-root
// (which runs before logger.ts can be imported) into the daily log.
-import { flushEarlyDiagnostics } from './install-data-root';
+import { flushEarlyDiagnostics } from './install-data-root.cjs';
{
const installLog = createLogger('install-data-root');
flushEarlyDiagnostics((m) => installLog.warn(m));
diff --git a/src/main/ipc/index.ts b/src/main/ipc/index.ts
index 93fdb556..9052f4b7 100644
--- a/src/main/ipc/index.ts
+++ b/src/main/ipc/index.ts
@@ -1137,20 +1137,7 @@ const invokeHandlers: Record<string, InvokeHandler> = {
'agents.update': async ({ agent_id, updates }) => {
if (!agents.isValidAgentId(agent_id)) throw new Error('invalid agent_id');
- let data = await agents.updateCustomAgent(agent_id, updates || {});
- if (!data) {
- try {
- const dev = await import('../features/agents_dev');
- data = await dev.updateBuiltinAgentSpec(agent_id, updates || {});
- } catch (err) {
- const code = (err as NodeJS.ErrnoException).code;
- if (code === 'MODULE_NOT_FOUND' || code === 'ERR_MODULE_NOT_FOUND') {
- data = null;
- } else {
- throw err;
- }
- }
- }
+ const data = await agents.updateCustomAgent(agent_id, updates || {});
if (!data) throw new Error('agent not found or read-only');
return { agent: data };
},
diff --git a/src/main/paths.ts b/src/main/paths.ts
index bf288f2c..46ea23b4 100644
--- a/src/main/paths.ts
+++ b/src/main/paths.ts
@@ -4,7 +4,7 @@
* All path constants live here — never hardcode paths elsewhere.
*
* Layout (dev and packaged both use this tree; the only platform variation
- * is in `<container>` — see install-data-root.ts):
+ * is in `<container>` — see install-data-root.cjs):
*
* PC_ROOT/ ← source + per-install binaries (asar-packed in prod)
* bootstrap.cjs package.json node_modules/ test/ docs/
diff --git a/src/main/smoke.ts b/src/main/smoke.ts
index 30691a63..803bd72f 100644
--- a/src/main/smoke.ts
+++ b/src/main/smoke.ts
@@ -33,7 +33,8 @@ async function section(name: string, fn: () => void | Promise<void>): Promise<vo
const { prompts, safeSubstitute } = await import('./prompts/loader');
console.log('[smoke] paths');
- await section('PC_ROOT ends with /PC', () => assert.ok(paths.PC_ROOT.endsWith('/PC')));
+ await section('PC_ROOT is repository root', () =>
+ assert.ok(fs.existsSync(path.join(paths.PC_ROOT, 'package.json'))));
await section('APP_ROOT === PC_ROOT (flat layout)', () => assert.ok(paths.APP_ROOT === paths.PC_ROOT));
await section('WS_ROOT derivable', () => assert.ok(paths.WS_ROOT.length > 0));
await section('USERS_FILE at data root', () =>