Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ NEXT_PUBLIC_ADMIN_URL=http://localhost:3003
NEXT_PUBLIC_MARKETING_URL=http://localhost:3002
NEXT_PUBLIC_DOCS_URL=http://localhost:3004

# -----------------------------------------------------------------------------
# Streams Server (AI Chat)
# -----------------------------------------------------------------------------
NEXT_PUBLIC_STREAMS_URL=http://localhost:8080
EXPO_PUBLIC_STREAMS_URL=http://localhost:8080
Comment on lines +33 to +34
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Reorder keys to satisfy dotenv-linter.

The linter expects EXPO_PUBLIC_STREAMS_URL before NEXT_PUBLIC_STREAMS_URL. Reordering will clear the warning.

🔧 Suggested reorder
-NEXT_PUBLIC_STREAMS_URL=http://localhost:8080
-EXPO_PUBLIC_STREAMS_URL=http://localhost:8080
+EXPO_PUBLIC_STREAMS_URL=http://localhost:8080
+NEXT_PUBLIC_STREAMS_URL=http://localhost:8080
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
NEXT_PUBLIC_STREAMS_URL=http://localhost:8080
EXPO_PUBLIC_STREAMS_URL=http://localhost:8080
EXPO_PUBLIC_STREAMS_URL=http://localhost:8080
NEXT_PUBLIC_STREAMS_URL=http://localhost:8080
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 34-34: [UnorderedKey] The EXPO_PUBLIC_STREAMS_URL key should go before the NEXT_PUBLIC_STREAMS_URL key

(UnorderedKey)

🤖 Prompt for AI Agents
In @.env.example around lines 33 - 34, Reorder the two environment variable
entries so EXPO_PUBLIC_STREAMS_URL appears before NEXT_PUBLIC_STREAMS_URL in the
.env.example file to satisfy dotenv-linter; specifically swap the lines
containing EXPO_PUBLIC_STREAMS_URL and NEXT_PUBLIC_STREAMS_URL so the key
EXPO_PUBLIC_STREAMS_URL comes first.


# -----------------------------------------------------------------------------
# Better Auth
# -----------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Git LFS tracking for large binaries (darwin-arm64 only for now)
apps/desktop/resources/bin/darwin-arm64/claude filter=lfs diff=lfs merge=lfs -text
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,13 @@ next-env.d.ts

# Reference material downloaded for agents
examples

# Streams data
apps/streams/data/

# Claude binaries - only darwin-arm64 tracked with Git LFS, others downloaded at build time
apps/desktop/resources/bin/VERSION
apps/desktop/resources/bin/darwin-x64/
apps/desktop/resources/bin/linux-arm64/
apps/desktop/resources/bin/linux-x64/
apps/desktop/resources/bin/win32-x64/
6 changes: 6 additions & 0 deletions apps/desktop/electron-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ const config: Configuration = {
to: "resources/migrations",
filter: ["**/*"],
},
// Claude Code binary - bundled for AI chat functionality
{
from: "resources/bin/${platform}-${arch}",
to: "bin",
filter: ["**/*"],
},
Comment on lines +59 to +64
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

find apps/desktop -type f -name "*download*" | head -20

Repository: superset-sh/superset

Length of output: 110


🏁 Script executed:

cat -n apps/desktop/scripts/download-claude-binary.ts 2>/dev/null || echo "File not found at expected path"

Repository: superset-sh/superset

Length of output: 12524


🌐 Web query:

electron-builder extraResources macro expansion platform arch variables

💡 Result:

In electron-builder, extraResources supports the same file-macro expansion as files patterns, and macros can be used in:

  • glob patterns you put in extraResources
  • FileSet.from and FileSet.to when you use the object form of extraResources ([{ from, to, filter }]) [1]

Supported macros relevant to platform/arch:

  • ${os}mac, linux, or win (target platform) [2]
  • ${arch} → e.g. ia32, x64 (and commonly arm64 in practice) [2]

Also available (often useful alongside): ${name}, ${productName}, ${version}, and ${env.MY_VAR} [2].

Example: platform + arch–specific resources

{
  "build": {
    "extraResources": [
      {
        "from": "resources/${os}/${arch}",
        "to": "resources/native",
        "filter": ["**/*"]
      }
    ]
  }
}

This copies resources/mac/x64/** (or resources/win/ia32/**, etc.) into the app’s packaged resources/native directory [1][2].

Notes:

  • If an arch isn’t being set for a given build, ${arch} is removed (with some cleanup of adjacent separators) rather than left literal [2].
  • Use ${os} (documented); ${platform} is not part of the documented macro set in electron-builder’s file macros list [2].

Sources: electron-builder “Application Contents” (extraResources + FileSet) [1], electron-builder “File Macros” list and behavior [2].


🌐 Web query:

electron-builder ${platform} ${arch} variable substitution path

💡 Result:

electron-builder supports “file macros” (variable substitution) in several path-like config fields, including output directories and FileSet from/to, not just artifactName.

Macros you’re asking about

Put platform/arch into the output path

{
  "build": {
    "directories": {
      "output": "releases/${platform}/${arch}"
    }
  }
}

This creates per-platform/per-arch folders under releases/. (stackoverflow.com)

Use platform/arch in copy paths (extraResources / extraFiles)

electron-builder allows file macros in FileSet from and to paths: (electron.build)

{
  "build": {
    "extraResources": [
      {
        "from": "bin/${platform}/${arch}/mytool",
        "to": "bin/mytool"
      }
    ]
  }
}

Use platform/arch in the artifact filename

{
  "build": {
    "artifactName": "${productName}-${version}-${platform}-${arch}.${ext}"
  }
}

artifactName explicitly supports these macros. (electron.build)

Citations:


${platform} is not a valid electron-builder macro; use ${os} instead, but platform names still won't match.
The extraResources.from path uses ${platform} and ${arch}, but electron-builder only expands ${os} (which yields mac/linux/win) and ${arch}. More critically, the download script creates directories using Node's naming (darwin-arm64, linux-x64, win32-x64), while electron-builder would resolve to mac-x64, linux-x64, win-x64. The paths won't align, and the binary won't be bundled.

Update the from path to match the directory structure created by the download script. Either:

  • Update the download script to use electron-builder's platform naming convention, or
  • Update electron-builder.ts to reference the actual directory structure created (e.g., conditional configuration per platform, or refactor how binaries are organized).
🤖 Prompt for AI Agents
In `@apps/desktop/electron-builder.ts` around lines 59 - 64, The
extraResources.from currently uses "resources/bin/${platform}-${arch}" which is
invalid for electron-builder and mismatches the download script's Node-style
dirs (e.g., darwin-arm64, linux-x64, win32-x64); update the config referenced by
extraResources.from to point to the actual directory names created by the
download script (or change the download script to emit electron-builder names).
Concretely, replace the single-template from with platform-aware logic: map
electron-builder ${os}/${arch} to the download-script names (or use
process.platform mapping such as darwin -> darwin, win32 -> win32, linux ->
linux and include arch) so the path used by extraResources.from matches the real
folders (or alternatively change the downloader to write mac/linux/win folders
to match electron-builder). Ensure the path string used by extraResources.from
exactly matches the download script's output naming convention.

],

files: [
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop/electron.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export default defineConfig({
process.env.NEXT_PUBLIC_DOCS_URL,
"https://docs.superset.sh",
),
"process.env.NEXT_PUBLIC_STREAMS_URL": defineEnv(
process.env.NEXT_PUBLIC_STREAMS_URL,
"http://localhost:8080",
),
"import.meta.env.DEV_SERVER_PORT": defineEnv(String(DEV_SERVER_PORT)),
"import.meta.env.NEXT_PUBLIC_POSTHOG_KEY": defineEnv(
process.env.NEXT_PUBLIC_POSTHOG_KEY,
Expand Down
15 changes: 10 additions & 5 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
"dev": "cross-env NODE_ENV=development electron-vite dev --watch",
"compile:app": "cross-env NODE_OPTIONS=--max-old-space-size=8192 electron-vite build",
"copy:native-modules": "bun run scripts/copy-native-modules.ts",
"prebuild": "bun run clean:dev && bun run compile:app && bun run copy:native-modules",
"download:claude": "bun run scripts/download-claude-binary.ts",
"upgrade:claude": "bun run scripts/upgrade-claude-binary.ts",
"prebuild": "bun run clean:dev && bun run compile:app && bun run copy:native-modules && bun run download:claude",
"build": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --publish never",
"prepackage": "bun run copy:native-modules",
"prepackage": "bun run copy:native-modules && bun run download:claude",
"package": "electron-builder --config electron-builder.ts",
"install:deps": "electron-builder install-app-deps",
"release": "electron-builder --publish always",
Expand All @@ -33,10 +35,12 @@
"test": "bun test"
},
"dependencies": {
"@anthropic-ai/claude-agent-sdk": "^0.2.19",
"@better-auth/stripe": "1.4.17",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@durable-streams/client": "^0.2.0",
"@electric-sql/client": "https://pkg.pr.new/@electric-sql/client@3724",
"@headless-tree/core": "^1.6.3",
"@headless-tree/react": "^1.6.3",
Expand All @@ -45,16 +49,17 @@
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-label": "^2.1.8",
"@sentry/electron": "^7.7.0",
"@superset/ai-chat": "workspace:*",
"@superset/auth": "workspace:*",
"@superset/db": "workspace:*",
"@superset/local-db": "workspace:*",
"@superset/shared": "workspace:*",
"@superset/trpc": "workspace:*",
"@superset/ui": "workspace:*",
"@t3-oss/env-core": "^0.13.8",
"@tanstack/db": "0.5.22",
"@tanstack/electric-db-collection": "0.2.27",
"@tanstack/react-db": "0.1.66",
"@tanstack/db": "^0.5.24",
"@tanstack/electric-db-collection": "0.2.30",
"@tanstack/react-db": "^0.1.68",
"@tanstack/react-query": "^5.90.19",
"@tanstack/react-router": "^1.147.3",
"@tanstack/react-table": "^8.21.3",
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/resources/bin/darwin-arm64/claude
Git LFS file not shown
Loading
Loading