Skip to content

Commit 1858e1e

Browse files
committed
feat: initial commit — MiniFlow frontend + CI release pipeline
0 parents  commit 1858e1e

65 files changed

Lines changed: 10042 additions & 0 deletions

Some content is hidden

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

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
9+
[*.{swift,py,ts,tsx,js,jsx,md,yml,yaml}]
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Bug report
3+
description: Report a bug
4+
labels: [bug]
5+
---
6+
7+
## Description
8+
9+
## Steps to reproduce
10+
11+
## Expected behavior
12+
13+
## Actual behavior
14+
15+
## Environment
16+
- macOS version:
17+
- MiniFlow version:
18+
19+
## Logs
20+
Paste relevant lines from `~/miniflow/miniflow.log`.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Security issue
4+
url: mailto:developer@smallest.ai
5+
about: Report a security vulnerability
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Feature request
3+
description: Suggest an idea
4+
labels: [enhancement]
5+
---
6+
7+
## Problem
8+
9+
## Proposed solution
10+
11+
## Alternatives considered
12+
13+
## Additional context

.github/workflows/build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build MiniFlow DMG
2+
3+
on:
4+
push:
5+
branches: [main, ui, development, ai]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: macos-15
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Get version
17+
id: version
18+
run: |
19+
VERSION=$(grep -m1 'MARKETING_VERSION' MiniflowApp/MiniflowApp.xcodeproj/project.pbxproj \
20+
| sed 's/.*= *//;s/;//;s/ *//')
21+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.11"
27+
28+
- name: Create venv & install dependencies
29+
run: |
30+
cd miniflow-engine
31+
python3 -m venv venv
32+
source venv/bin/activate
33+
pip install --upgrade pip
34+
pip install -r requirements.txt
35+
36+
- name: Import signing certificate
37+
if: ${{ env.APPLE_CERTIFICATE_BASE64 != '' }}
38+
env:
39+
APPLE_CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
40+
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
41+
run: |
42+
KEYCHAIN_PATH=$RUNNER_TEMP/build.keychain
43+
KEYCHAIN_PASSWORD=$(openssl rand -hex 16)
44+
echo "$APPLE_CERTIFICATE_BASE64" | base64 --decode -o $RUNNER_TEMP/certificate.p12
45+
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
46+
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
47+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
48+
security import "$RUNNER_TEMP/certificate.p12" \
49+
-k "$KEYCHAIN_PATH" \
50+
-P "$APPLE_CERTIFICATE_PASSWORD" \
51+
-T /usr/bin/codesign
52+
security list-keychains -d user -s "$KEYCHAIN_PATH" $(security list-keychains -d user | tr -d '"')
53+
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
54+
55+
- name: Build (backend + Swift app + DMG)
56+
run: |
57+
chmod +x build_all.sh build_backend.sh build_dmg.sh
58+
./build_all.sh
59+
env:
60+
CONFIG: Release
61+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
62+
APPLE_ID: ${{ secrets.APPLE_ID }}
63+
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
64+
65+
- name: Upload DMG
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: MiniFlow-${{ steps.version.outputs.version }}
69+
path: build/MiniFlow-${{ steps.version.outputs.version }}.dmg
70+
retention-days: 30

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Build & Release MiniFlow DMG
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: macos-15
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Get version
17+
id: version
18+
run: |
19+
VERSION=$(grep -m1 'MARKETING_VERSION' MiniflowApp/MiniflowApp.xcodeproj/project.pbxproj \
20+
| sed 's/.*= *//;s/;//;s/ *//')
21+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.11"
27+
28+
- name: Create venv & install dependencies
29+
run: |
30+
cd miniflow-engine
31+
python3 -m venv venv
32+
source venv/bin/activate
33+
pip install --upgrade pip
34+
pip install -r requirements.txt
35+
36+
- name: Import signing certificate
37+
env:
38+
APPLE_CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
39+
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
40+
run: |
41+
if [ -z "$APPLE_CERTIFICATE_BASE64" ]; then exit 0; fi
42+
KEYCHAIN_PATH=$RUNNER_TEMP/build.keychain
43+
KEYCHAIN_PASSWORD=$(openssl rand -hex 16)
44+
echo "$APPLE_CERTIFICATE_BASE64" | base64 --decode -o $RUNNER_TEMP/certificate.p12
45+
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
46+
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
47+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
48+
security import "$RUNNER_TEMP/certificate.p12" \
49+
-k "$KEYCHAIN_PATH" \
50+
-P "$APPLE_CERTIFICATE_PASSWORD" \
51+
-T /usr/bin/codesign
52+
security list-keychains -d user -s "$KEYCHAIN_PATH" $(security list-keychains -d user | tr -d '"')
53+
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
54+
55+
- name: Build (backend + Swift app + DMG)
56+
run: |
57+
chmod +x build_all.sh build_backend.sh build_dmg.sh
58+
./build_all.sh
59+
env:
60+
CONFIG: Release
61+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
62+
APPLE_ID: ${{ secrets.APPLE_ID }}
63+
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
64+
65+
- name: Create GitHub Release
66+
env:
67+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
run: |
69+
VERSION="${{ steps.version.outputs.version }}"
70+
DMG="build/MiniFlow-${VERSION}.dmg"
71+
TAG="v${VERSION}-$(date +%Y%m%d%H%M%S)"
72+
gh release create "$TAG" "$DMG" \
73+
--repo malikaasm/miniFront \
74+
--title "MiniFlow v${VERSION}" \
75+
--notes "Download **MiniFlow-${VERSION}.dmg** below, open it, and drag MiniFlow.app to Applications." \
76+
--latest

.gitignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Build outputs
2+
build/
3+
miniflow-engine/dist/
4+
miniflow-engine/build/
5+
miniflow-engine/__pycache__/
6+
miniflow-engine/*.spec
7+
**/__pycache__/
8+
**/*.pyc
9+
10+
# Xcode
11+
*.xcuserdata/
12+
xcuserdata/
13+
DerivedData/
14+
*.xcbuilddata
15+
*.xcresult
16+
*.dSYM
17+
18+
# Node / Vite
19+
node_modules/
20+
dist/
21+
22+
# macOS
23+
.DS_Store
24+
**/.DS_Store
25+
26+
# Secrets / config (never commit API keys)
27+
miniflow/
28+
oauth_clients.json
29+
miniflow_keys.json
30+
*.env
31+
.env*
32+
33+
# Python venvs
34+
miniflow-engine/.venv/
35+
miniflow-engine/venv/
36+
37+
# Claude internal docs
38+
.claude/
39+
40+
# Vercel deployment config
41+
.vercel/
42+
43+
# IDE config
44+
.vscode/
45+
46+
# Runtime files
47+
miniflow.log
48+
history.json

CODE_OF_CONDUCT.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Code of Conduct
2+
3+
We follow the Contributor Covenant.
4+
5+
## Our Pledge
6+
7+
We pledge to make participation in our community a harassment-free experience for everyone.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment include:
12+
13+
- Using welcoming and inclusive language
14+
- Being respectful of differing viewpoints and experiences
15+
- Accepting constructive criticism
16+
17+
Examples of unacceptable behavior include:
18+
19+
- Harassment, trolling, or personal attacks
20+
- Publishing others' private information
21+
22+
## Enforcement
23+
24+
Instances of abusive behavior may be reported to developer@smallest.ai.
25+
26+
## Attribution
27+
28+
This Code of Conduct is adapted from the Contributor Covenant, version 2.1.

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Contributing
2+
3+
Thanks for helping improve MiniFlow.
4+
5+
## Quick start
6+
7+
1. Fork the repo and create a feature branch.
8+
2. Make your changes.
9+
3. Run existing scripts/tests if relevant.
10+
4. Open a PR with a clear description.
11+
12+
## Development notes
13+
14+
- Swift app lives in `MiniflowApp/`.
15+
- Python engine lives in `miniflow-engine/`.
16+
- Build the DMG with `./build_all.sh`.
17+
18+
## Code style
19+
20+
- Keep changes focused and minimal.
21+
- Prefer small, reviewable commits.
22+
23+
## Reporting issues
24+
25+
Please include:
26+
- macOS version
27+
- Steps to reproduce
28+
- Expected vs actual behavior
29+
- Logs from `~/miniflow/miniflow.log`

ENGINEERING.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# MiniFlow Engineering (Swift + Smallest)
2+
3+
This repository is intentionally structured around a single runtime path:
4+
5+
- `MiniflowApp/` - native macOS app (Swift/SwiftUI)
6+
- `miniflow-engine/` - local Python engine (FastAPI)
7+
- `miniflow-auth/` - OAuth proxy (Vercel, optional for integrations)
8+
9+
Legacy web/Tauri artifacts have been removed from the root to avoid split build paths.
10+
11+
## System Architecture
12+
13+
```text
14+
MiniflowApp (Swift) <-> miniflow-engine (FastAPI on localhost:8765)
15+
|
16+
+-> Smallest AI Waves (speech-to-text)
17+
+-> OpenAI (agent/tool orchestration)
18+
+-> OAuth-backed connectors (Slack, GitHub, etc.)
19+
```
20+
21+
## Speech and Command Flow
22+
23+
1. Swift captures microphone audio.
24+
2. Swift posts base64 PCM chunks to engine commands (`start_listening`, `send_audio_chunk`, `stop_listening`).
25+
3. Engine streams audio to Smallest AI Waves over WebSocket.
26+
4. Engine emits transcript events over `ws://127.0.0.1:8765/ws`.
27+
5. Swift receives final transcript and invokes `execute_command`.
28+
6. Engine runs local tools and connector tools, then emits action results.
29+
30+
## API Key Contract
31+
32+
The engine key contract is:
33+
34+
- `openai`
35+
- `smallest`
36+
37+
`has_api_keys` returns:
38+
39+
```json
40+
{
41+
"openai": "string|null",
42+
"smallest": "string|null"
43+
}
44+
```
45+
46+
## Build and Packaging
47+
48+
Primary build path:
49+
50+
1. `./build_backend.sh` - bundles Python engine
51+
2. `./build_all.sh` - builds Swift app, embeds engine, creates DMG
52+
53+
DMG-only packaging (for an already built app):
54+
55+
- `APP_PATH=build/MiniFlow.app ./build_dmg.sh`
56+
57+
## Source of Truth
58+
59+
If docs conflict with code, treat these as canonical:
60+
61+
- Runtime and UI behavior: `MiniflowApp/`
62+
- Engine API/events: `miniflow-engine/main.py`
63+
- STT provider behavior: `miniflow-engine/audio.py`
64+
- API key storage contract: `miniflow-engine/config.py`

0 commit comments

Comments
 (0)