Skip to content

Commit bf488c8

Browse files
authored
Merge branch 'main' into feat/webchat-reactions
2 parents 5602959 + b5a700c commit bf488c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+8404
-2535
lines changed

.github/workflows/interface-ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Interface CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "interface/**"
8+
- ".github/workflows/interface-ci.yml"
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- "interface/**"
13+
- ".github/workflows/interface-ci.yml"
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: interface-ci-${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
quality:
24+
name: Interface Quality
25+
runs-on: ubuntu-24.04
26+
defaults:
27+
run:
28+
working-directory: interface
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- uses: oven-sh/setup-bun@v1
33+
with:
34+
bun-version: "1.3"
35+
36+
- name: Install dependencies
37+
run: bun ci
38+
39+
- name: Typecheck
40+
run: bunx tsc --noEmit

.github/workflows/release.yml

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -115,27 +115,15 @@ jobs:
115115
id: platform
116116
run: echo "pair=$(echo ${{ matrix.platform }} | tr '/' '-')" >> "$GITHUB_OUTPUT"
117117

118-
- name: Build and push slim
118+
- name: Build and push
119119
uses: docker/build-push-action@v6
120120
with:
121121
context: .
122-
target: slim
123122
platforms: ${{ matrix.platform }}
124123
push: true
125-
tags: ${{ env.IMAGE }}:slim-${{ steps.platform.outputs.pair }}
126-
cache-from: type=gha,scope=slim-${{ steps.platform.outputs.pair }}
127-
cache-to: type=gha,mode=max,scope=slim-${{ steps.platform.outputs.pair }}
128-
129-
- name: Build and push full
130-
uses: docker/build-push-action@v6
131-
with:
132-
context: .
133-
target: full
134-
platforms: ${{ matrix.platform }}
135-
push: true
136-
tags: ${{ env.IMAGE }}:full-${{ steps.platform.outputs.pair }}
137-
cache-from: type=gha,scope=full-${{ steps.platform.outputs.pair }}
138-
cache-to: type=gha,mode=max,scope=full-${{ steps.platform.outputs.pair }}
124+
tags: ${{ env.IMAGE }}:build-${{ steps.platform.outputs.pair }}
125+
cache-from: type=gha,scope=build-${{ steps.platform.outputs.pair }}
126+
cache-to: type=gha,mode=max,scope=build-${{ steps.platform.outputs.pair }}
139127

140128
merge-docker:
141129
needs: build-docker
@@ -155,22 +143,13 @@ jobs:
155143
username: ${{ github.actor }}
156144
password: ${{ secrets.GITHUB_TOKEN }}
157145

158-
- name: Create slim multi-arch manifest
159-
run: |
160-
docker buildx imagetools create \
161-
--tag ${{ env.IMAGE }}:${{ needs.build-docker.outputs.version }}-slim \
162-
--tag ${{ env.IMAGE }}:slim \
163-
${{ env.IMAGE }}:slim-linux-amd64 \
164-
${{ env.IMAGE }}:slim-linux-arm64
165-
166-
- name: Create full multi-arch manifest
146+
- name: Create multi-arch manifest
167147
run: |
168148
docker buildx imagetools create \
169-
--tag ${{ env.IMAGE }}:${{ needs.build-docker.outputs.version }}-full \
170-
--tag ${{ env.IMAGE }}:full \
149+
--tag ${{ env.IMAGE }}:${{ needs.build-docker.outputs.version }} \
171150
--tag ${{ env.IMAGE }}:latest \
172-
${{ env.IMAGE }}:full-linux-amd64 \
173-
${{ env.IMAGE }}:full-linux-arm64
151+
${{ env.IMAGE }}:build-linux-amd64 \
152+
${{ env.IMAGE }}:build-linux-arm64
174153
175154
- name: Log in to Fly registry
176155
if: github.repository_owner == 'spacedriveapp'

AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ Single binary. No server dependencies. Runs on tokio. All data lives in embedded
1010

1111
**Stack:** Rust (edition 2024), tokio, Rig (v0.30.0, agentic loop framework), SQLite (sqlx), LanceDB (embedded vector + FTS), redb (embedded key-value).
1212

13+
## JavaScript Tooling (Critical)
14+
15+
- For UI work in `spacebot/interface/`, use `bun` for all JS/TS package management and scripts.
16+
- **NEVER** use `npm`, `pnpm`, or `yarn` in this repo unless the user explicitly asks for one.
17+
- Standard commands:
18+
- `bun install`
19+
- `bun run dev`
20+
- `bun run build`
21+
- `bun run test`
22+
- `bunx <tool>` (instead of `npx <tool>`)
23+
1324
## Migration Safety
1425

1526
- **NEVER edit an existing migration file in place** once it has been committed or applied in any environment.

Cargo.lock

Lines changed: 74 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ notify = "7"
6161
# Cryptography (for secrets)
6262
aes-gcm = "0.10"
6363
sha2 = "0.10"
64+
argon2 = "0.5"
6465
rand = "0.9"
6566

6667
# UUID generation
@@ -131,7 +132,7 @@ arrow-array = "57.3.0"
131132
arrow-schema = "57.3.0"
132133

133134
# Browser automation
134-
chromiumoxide = { version = "0.8", features = ["tokio-runtime"], default-features = false }
135+
chromiumoxide = { version = "0.8", features = ["tokio-runtime", "_fetcher-rustls-tokio"], default-features = false }
135136
chromiumoxide_cdp = "0.8"
136137

137138
# Templating for prompts
@@ -165,6 +166,10 @@ unimplemented = "deny"
165166
[dev-dependencies]
166167
tokio-test = "0.4"
167168

169+
# OS keystore (macOS Keychain for master key storage)
170+
[target.'cfg(target_os = "macos")'.dependencies]
171+
security-framework = "3"
172+
168173
[profile.release]
169174
lto = "thin"
170175
strip = true

Dockerfile

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,38 +43,21 @@ RUN SPACEBOT_SKIP_FRONTEND_BUILD=1 cargo build --release \
4343
&& mv /build/target/release/spacebot /usr/local/bin/spacebot \
4444
&& cargo clean -p spacebot --release --target-dir /build/target
4545

46-
# ---- Slim stage ----
47-
# Minimal runtime with just the binary. No browser.
48-
FROM debian:bookworm-slim AS slim
46+
# ---- Runtime stage ----
47+
# Minimal runtime with Chrome runtime libraries for fetcher-downloaded Chromium.
48+
# Chrome itself is downloaded on first browser tool use and cached on the volume.
49+
FROM debian:bookworm-slim
4950

5051
RUN apt-get update && apt-get install -y --no-install-recommends \
5152
ca-certificates \
5253
libsqlite3-0 \
5354
curl \
5455
gh \
5556
bubblewrap \
56-
&& rm -rf /var/lib/apt/lists/*
57-
58-
COPY --from=builder /usr/local/bin/spacebot /usr/local/bin/spacebot
59-
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
60-
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
61-
62-
ENV SPACEBOT_DIR=/data
63-
ENV SPACEBOT_DEPLOYMENT=docker
64-
EXPOSE 19898 18789
65-
66-
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
67-
CMD curl -f http://localhost:19898/api/health || exit 1
68-
69-
ENTRYPOINT ["docker-entrypoint.sh"]
70-
CMD ["spacebot", "start", "--foreground"]
71-
72-
# ---- Full stage ----
73-
# Slim + Chromium for browser workers.
74-
FROM slim AS full
75-
76-
RUN apt-get update && apt-get install -y --no-install-recommends \
77-
chromium \
57+
openssh-server \
58+
# Chrome runtime dependencies — required whether Chrome is system-installed
59+
# or downloaded by the built-in fetcher. The fetcher provides the browser
60+
# binary; these are the shared libraries it links against.
7861
fonts-liberation \
7962
libnss3 \
8063
libatk-bridge2.0-0 \
@@ -91,5 +74,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
9174
libxtst6 \
9275
&& rm -rf /var/lib/apt/lists/*
9376

94-
ENV CHROME_PATH=/usr/bin/chromium
95-
ENV CHROME_FLAGS="--no-sandbox --disable-dev-shm-usage --disable-gpu"
77+
COPY --from=builder /usr/local/bin/spacebot /usr/local/bin/spacebot
78+
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
79+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
80+
81+
ENV SPACEBOT_DIR=/data
82+
ENV SPACEBOT_DEPLOYMENT=docker
83+
EXPOSE 19898 18789
84+
85+
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
86+
CMD curl -f http://localhost:19898/api/health || exit 1
87+
88+
ENTRYPOINT ["docker-entrypoint.sh"]
89+
CMD ["spacebot", "start", "--foreground"]

0 commit comments

Comments
 (0)