Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@cursor/sdk": "1.0.35",
"@effect/platform-node": "catalog:",
"@effect/platform-node-shared": "catalog:",
"@ff-labs/fff-node": "0.9.4",
"@ff-labs/fff-node": "0.11.0",
"@muse-code/sdk": "1.4.2",
"@napi-rs/keyring": "^1.3.0",
"@opencode-ai/sdk": "^1.3.15",
Expand Down
36 changes: 36 additions & 0 deletions apps/server/src/workspace/WorkspaceEntries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,42 @@ it.layer(layerTest, { excludeTestServices: true })("WorkspaceEntries", (it) => {
60_000,
);

it.effect("includes images and other binary files in non-git workspace indexes", () =>
Effect.gen(function* () {
const cwd = yield* makeTempDir();
const imagePaths = ["photo.png", "photo.jpg", "photo.jpeg"];
const binaryPaths = [...imagePaths, "document.pdf", "archive.zip", "data.bin"];
for (const filePath of binaryPaths) {
yield* writeTextFile(cwd, filePath, "\0binary contents\n");
}
yield* writeTextFile(cwd, "notes.txt", "plain text\n");

const workspaceEntries = yield* WorkspaceEntries.WorkspaceEntries;
const expectedPaths = [...binaryPaths, "notes.txt"].toSorted();
const listed = yield* workspaceEntries.list({ cwd });
expect(listed.entries.map((entry) => entry.path).toSorted()).toEqual(expectedPaths);
expect(listed.truncated).toBe(false);

const searched = yield* workspaceEntries.search({
cwd,
query: "",
limit: 100,
kind: "file",
});
expect(searched.entries.map((entry) => entry.path).toSorted()).toEqual(expectedPaths);
expect(searched.truncated).toBe(false);

const images = yield* workspaceEntries.search({
cwd,
query: "",
limit: 100,
imageOnly: true,
});
expect(images.entries.map((entry) => entry.path).toSorted()).toEqual(imagePaths.toSorted());
expect(images.truncated).toBe(false);
}),
);

it.effect("returns the complete cached workspace index", () =>
Effect.gen(function* () {
const cwd = yield* makeTempDir();
Expand Down
52 changes: 52 additions & 0 deletions patches/@ff-labs__fff-node@0.11.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
diff --git a/package.json b/package.json
index e000a78..8432546 100644
--- a/package.json
+++ b/package.json
@@ -11,7 +11,7 @@
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
- "require": "./dist/index.cjs",
+ "require": "./dist/index.js",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
diff --git a/dist/index.js b/dist/index.js
index 7c1d722..1d0bc27 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,7 +1,7 @@
// src/binary.ts
import { existsSync, readFileSync } from "fs";
import { createRequire } from "module";
-import { dirname, join } from "path";
+import { dirname, join, sep } from "path";
import { fileURLToPath } from "url";

// src/platform.ts
@@ -120,6 +120,16 @@ function getPackageDir() {
function binaryExists() {
return findBinary() !== null;
}
+function resolveUnpackedAsarPath(binaryPath) {
+ const pathSegments = binaryPath.split(sep);
+ const asarIndex = pathSegments.findLastIndex((segment) => segment.endsWith(".asar"));
+ if (asarIndex === -1) {
+ return binaryPath;
+ }
+ pathSegments[asarIndex] = `${pathSegments[asarIndex]}.unpacked`;
+ const unpackedPath = pathSegments.join(sep);
+ return existsSync(unpackedPath) ? unpackedPath : binaryPath;
+}
function resolveFromNpmPackage() {
const packageName = getNpmPackageName();
try {
@@ -128,7 +138,7 @@ function resolveFromNpmPackage() {
const packageDir = dirname(packageJsonPath);
const binaryPath = join(packageDir, getLibFilename());
if (existsSync(binaryPath)) {
- return binaryPath;
+ return resolveUnpackedAsarPath(binaryPath);
}
} catch {
}
53 changes: 0 additions & 53 deletions patches/@ff-labs__fff-node@0.9.4.patch

This file was deleted.

87 changes: 48 additions & 39 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ patchedDependencies:
"@expo/metro-config@58.0.6": patches/@expo__metro-config@58.0.6.patch
expo-sharing@58.0.13: patches/expo-sharing@58.0.13.patch
expo-widgets@58.0.11: patches/expo-widgets@58.0.11.patch
"@ff-labs/fff-node@0.9.4": patches/@ff-labs__fff-node@0.9.4.patch
"@ff-labs/fff-node@0.11.0": patches/@ff-labs__fff-node@0.11.0.patch
"@legendapp/list@3.3.5": patches/@legendapp__list@3.3.5.patch
"@opencode/client@2.0.23": patches/@opencode__client@2.0.23.patch
"@opencode/protocol@2.0.23": patches/@opencode__protocol@2.0.23.patch
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-desktop-artifact.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
primaryProbe.args[4],
path.join(
fixture.packagedAppDir,
"resources/server.asar/node_modules/@ff-labs/fff-node/dist/src/index.js",
"resources/server.asar/node_modules/@ff-labs/fff-node/dist/index.js",
),
);
assert.equal(primaryProbe.options.cwd, fixture.packagedAppDir);
Expand Down
5 changes: 1 addition & 4 deletions scripts/build-desktop-artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3236,10 +3236,7 @@ export const verifyWindowsPrimaryFffNativeLoad = Effect.fn(
const probeRoot = yield* fs.makeTempDirectoryScoped({
prefix: "t3code-windows-primary-native-probe-",
});
const fffEntryPath = path.join(
input.asarPath,
"node_modules/@ff-labs/fff-node/dist/src/index.js",
);
const fffEntryPath = path.join(input.asarPath, "node_modules/@ff-labs/fff-node/dist/index.js");
const probeEnv = { ...process.env };
delete probeEnv.ELECTRON_NO_ASAR;
delete probeEnv.NODE_OPTIONS;
Expand Down
Loading