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.

Preserve pinned resource bytes on Windows checkouts

wyta80ecc30657f
diff --git a/.gitattributes b/.gitattributes
index d2f521dc..f187d94c 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,6 @@
# Vite cannot transform hashbang ESM scripts with CRLF line endings.
*.mjs text eol=lf
+
+# Bundled resources carry reviewed byte/hash pins; Git must preserve them on
+# Windows as well as POSIX, including text workers, licenses and Skill files.
+resources/** -text
diff --git a/test/main/model/local-tools.test.ts b/test/main/model/local-tools.test.ts
index 7840e0e1..72891e0e 100644
--- a/test/main/model/local-tools.test.ts
+++ b/test/main/model/local-tools.test.ts
@@ -3015,8 +3015,11 @@ describe('local-tools › bash sensitive approval modes (e2e)', () => {
});
try {
const bash = lt.createLocalTools(OPTS).find((tool) => tool.name === 'bash')!;
- const res = await bash.execute({ command: 'source .venv/bin/activate && wc -l data/input.csv', timeoutMs: 5000 }, makeCtx());
+ // The default host shell is /bin/sh, which is dash on Linux. This
+ // Bash-specific activation fixture must select Bash explicitly.
+ const res = await bash.execute({ command: "bash -c 'source .venv/bin/activate && wc -l data/input.csv'", timeoutMs: 5000 }, makeCtx());
expect(prompts).toEqual([]);
+ expect(res.isError, String(res.content)).toBeFalsy();
expect(String(res.content)).toContain('input.csv');
} finally {
bashPerms._setBroadcastForTest(null);
diff --git a/test/main/util/ensure-dev-dependencies.test.ts b/test/main/util/ensure-dev-dependencies.test.ts
index a2fd8984..ef80fe4d 100644
--- a/test/main/util/ensure-dev-dependencies.test.ts
+++ b/test/main/util/ensure-dev-dependencies.test.ts
@@ -85,7 +85,7 @@ async function prepare(platform = 'darwin', fail = '', fault = 'exit') {
describe('development dependency preparation', () => {
it.each(['darwin', 'win32'])('overlaps independent preparation on %s and waits for every prerequisite', async platform => {
const run = await prepare(platform);
- expect(run.peak).toBe(2);
+ expect(run.peak, run.messages.join('\n')).toBe(2);
expect(run.readyWhileActive).toBe(false);
expect(run.exitCode).toBe(0);
expect(run.nativePrerequisites).toEqual(expect.arrayContaining([
@@ -104,6 +104,7 @@ describe('development dependency preparation', () => {
it.each(['verify-native-dependencies.cjs:host', 'build-phone-passkey.cjs', 'verify-native-dependencies.cjs', 'fetch-embedding-model.mjs'])(
'fails readiness and drains running preparation after %s fails', async fail => {
const run = await prepare('darwin', fail);
+ expect(run.calls).toContain(fail);
expect(run.exitCode).toBe(1);
expect(run.exitWhileActive).toBe(false);
expect(run.messages.join('\n')).not.toContain('built-in dependencies ready');
@@ -123,6 +124,7 @@ describe('development dependency preparation', () => {
it.each(['spawn', 'signal'])('drains the other lane after a child %s failure', async fault => {
const run = await prepare('darwin', 'fetch-embedding-model.mjs', fault);
+ expect(run.calls).toContain('fetch-embedding-model.mjs');
expect(run.exitCode).toBe(1);
expect(run.exitWhileActive).toBe(false);
expect(run.calls).not.toContain('fetch-officecli.cjs');
diff --git a/test/main/util/packaged-resource-gate.test.ts b/test/main/util/packaged-resource-gate.test.ts
index c1da6f41..4d1e05c8 100644
--- a/test/main/util/packaged-resource-gate.test.ts
+++ b/test/main/util/packaged-resource-gate.test.ts
@@ -1,5 +1,6 @@
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import * as crypto from 'node:crypto';
+import { execFileSync } from 'node:child_process';
import { createRequire } from 'node:module';
import * as fs from 'node:fs';
import * as os from 'node:os';
@@ -59,6 +60,19 @@ describe('packaged-resource-gate', () => {
expect(verifyXlsReaderRoot(path.join(process.cwd(), 'resources/xls-reader'))).toBe('resource:xls-reader:2.0.2');
});
+ it('preserves pinned XLS bytes through Windows Git checkout filters', () => {
+ const root = path.join(tmpDir, 'windows-checkout');
+ fs.mkdirSync(path.join(root, '2.0.2'), { recursive: true });
+ for (const name of ['LICENSE', 'read.py', 'xlrd-2.0.2-py2.py3-none-any.whl']) {
+ const tracked = `resources/xls-reader/2.0.2/${name}`;
+ const bytes = execFileSync('git', [
+ '-c', 'core.autocrlf=true', 'cat-file', '--filters', `--path=${tracked}`, `HEAD:${tracked}`,
+ ], { cwd: process.cwd(), timeout: 10_000 });
+ fs.writeFileSync(path.join(root, '2.0.2', name), bytes);
+ }
+ expect(verifyXlsReaderRoot(root)).toBe('resource:xls-reader:2.0.2');
+ });
+
it.each(['Orkas.app/Contents/Resources', 'win-unpacked/resources'])('verifies XLS resources in %s and rejects missing or changed payloads', layout => {
const root = path.join(tmpDir, layout, 'xls-reader');
fs.cpSync(path.join(process.cwd(), 'resources/xls-reader'), root, { recursive: true });