Skip to content
Open
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
65bc3e2
feat(ai): add AI Slice Assistant dockable panel scaffold
Feb 7, 2026
3b9a507
feat(ai): add context snapshot builder
Feb 7, 2026
733d2f7
feat(ai): add provider interface and fake provider
Feb 7, 2026
aa66e65
feat(ai): add response validation and repair loop
Feb 7, 2026
fa40fbf
feat(ai): add allowlist registry for adjustable settings
Feb 7, 2026
8e7ba89
feat(ai): add diff/apply/undo for AI recommendations
Feb 7, 2026
9487c2a
feat(ai): add context snapshot builder
Feb 7, 2026
53a3390
fix(ai): make AISliceAssistantPanel compile on macOS
Feb 7, 2026
3393e75
feat(ai): add provider interface and fake provider
Feb 7, 2026
36fc0e7
feat(ai): add response validation and repair loop
Feb 7, 2026
552c455
feat(ai): add allowlist registry for adjustable settings
Feb 7, 2026
3216d0e
feat(ai): add diff/apply/undo for AI recommendations
Feb 7, 2026
a13a41c
feat(ai): add OpenAI-compatible provider and AI preferences
Feb 8, 2026
0591072
feat(ai): add safe mode, presets, and debug export
Feb 8, 2026
269b5e4
docs(ai): add public quickstart and safety documentation
Feb 8, 2026
06438ea
chore(release): add macOS beta packaging script and docs
Feb 8, 2026
ff3e68b
fix(ai): make input box editable and focusable
Feb 8, 2026
2ef2f80
fix(ai): correct panel layout and input sizing
Feb 8, 2026
7a2a4fc
ui(ai): improve recommendations list columns
Feb 8, 2026
93dce19
fix(ai): block geometry edits and auto-convert to slicing reinforceme…
Feb 8, 2026
592c54f
fix(ai): request JSON-mode via response_format when available
Feb 8, 2026
d4eee2d
fix(ui): avoid AI panel startup crash in context card
Feb 8, 2026
96946b6
fix(ai): avoid startup crash in AI context card
Feb 8, 2026
23a97fa
style(ui): AI panel cards + more options menu
Feb 8, 2026
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
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ If you come across any of these in search results, please <b>report them</b> as
Supports a broad range of printers: Bambu Lab, Prusa, Creality, Voron, and more.
- Additional features can be found in the [change notes](https://github.com/OrcaSlicer/OrcaSlicer/releases/).

# AI Slice Assistant (Experimental)

AI Slice Assistant can suggest slicer setting changes from the current project context.
It does **not** provide general-purpose chat, direct printer control, or guaranteed print outcomes.

- Quick start: [docs/ai/QUICKSTART.md](docs/ai/QUICKSTART.md)
- Safety model: [docs/ai/SAFETY.md](docs/ai/SAFETY.md)
- Debug bundle guide: [docs/ai/DEBUG_BUNDLE.md](docs/ai/DEBUG_BUNDLE.md)

## Screenshots (placeholders)

- `docs/ai/assets/ai_panel_placeholder.png` (AI panel)
- `docs/ai/assets/ai_preferences_placeholder.png` (AI provider settings)
- `docs/ai/assets/ai_diff_placeholder.png` (recommended changes and apply/undo)

# Wiki

The [wiki](https://www.orcaslicer.com/wiki) aims to provide a detailed explanation of the slicer settings, including how to maximize their use and how to calibrate and set up your printer.
Expand Down
42 changes: 42 additions & 0 deletions docs/ai/DEBUG_BUNDLE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# AI Debug Bundle

## Purpose

The **Export Debug Bundle** button creates a JSON file to help diagnose AI Slice Assistant issues.

## How To Export

1. Open **AI Slice Assistant** panel.
2. Reproduce the issue (or run the scenario you want to report).
3. Click **Export Debug Bundle**.
4. Choose a file location in the save dialog.

## What Is Included

The exported JSON includes:

- `last_context_snapshot_json`
- `last_geometry_insights_json`
- `last_ai_response_json`
- `validation_errors`
- `app` metadata (`name`, `version`, `platform`)

## How To Share For Bug Reports

1. Open an issue in the OrcaSlicer repository.
2. Describe:
- What you expected.
- What happened.
- Exact steps to reproduce.
3. Attach the exported debug bundle JSON.
4. Include whether you used `Fake` or `OpenAI-compatible` provider.

## Privacy And Safety Notes

- Review the JSON before sharing.
- Remove any sensitive information you do not want to publish.
- API keys should not be required for debugging and should never be shared in issue comments.

## Disclaimer

AI suggestions are not guaranteed. Always verify recommendations before applying them to real prints.
56 changes: 56 additions & 0 deletions docs/ai/QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# AI Slice Assistant Quickstart

## What It Does

AI Slice Assistant helps you review proposed **slicer/print setting** changes for the current project.
It builds a context snapshot, sends it to the selected provider, validates the JSON response, and shows a diff you can apply or undo.

## What It Does Not Do

- No general-purpose chat assistant.
- No direct printer control or machine actions.
- No guarantee that suggestions are correct for your printer/material/part.

## Enable The Panel

1. Open OrcaSlicer.
2. Use the **View** menu and enable **AI Slice Assistant**.

## Configure Provider

1. Open **Preferences**.
2. Go to **Online > AI**.
3. Select provider:
- `Fake` for deterministic offline testing.
- `OpenAI-compatible` for HTTP provider testing.
4. If using OpenAI-compatible, set:
- Base URL
- API key
- Model
- Timeout / Max tokens / Temperature
5. Click **Test** to verify connection.

## First Test (Recommended)

1. In the AI panel, click **Copy Context**.
2. Enter a focused prompt, for example:
- `Improve bridging quality while keeping print time reasonable.`
3. Click **Send**.
4. Check status in chat:
- `Valid`, `Repaired`, or `Rejected`.
5. Review `recommended_changes` and details.
6. Optionally click **Apply Selected**.
7. If needed, click **Undo Last Apply**.

## Safe Mode

Safe Mode is enabled by default in **Preferences > Online > AI**.
When enabled, it limits risk by:

- Capping recommendations to 10.
- Blocking high-risk keys.
- Requiring user confirmation for temperature/flow/speed-related changes.

## Important Disclaimer

AI suggestions are not guaranteed. Always verify recommendations before applying them to real prints.
62 changes: 62 additions & 0 deletions docs/ai/RELEASING_MAC_BETA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Releasing macOS Beta (AI Branch)

Ce guide explique comment construire et empaqueter une beta macOS de OrcaSlicer-AI.

## Prerequis

- macOS avec Xcode/Command Line Tools installes.
- Dependances de build deja configurees pour OrcaSlicer.
- Depot a jour et propre (`git status`).

## Build + Package (script unique)

Depuis la racine du repo:

```bash
./scripts/release/macos_beta_package.sh
```

Le script effectue:

1. `./build_release_macos.sh`
2. Detection de `OrcaSlicer.app` genere
3. Generation de `BUILD_INFO.txt` (hash git, date, macOS, architecture)
4. Creation d'une archive zip versionnee:
- Exemple: `OrcaSlicer-AI-beta-arm64-YYYYMMDD-<hash7>.zip`

Sortie attendue:

- `build/release/OrcaSlicer-AI-beta-*.zip`

## Validation rapide avant publication

- Ouvrir l'app locale et verifier l'ecran principal.
- Verifier que le panneau AI est present.
- Verifier que `BUILD_INFO.txt` est bien inclus dans le zip.

## Publication beta (exemple)

1. Uploader le zip comme asset d'une pre-release GitHub.
2. Ajouter les points de test attendus dans les release notes.
3. Inclure commit hash et date de build.

## Optionnel: Code signing / Notarization (placeholders)

Selon votre process de release, vous pouvez ajouter:

- Signature de `OrcaSlicer.app` avec certificat Developer ID.
- Notarization Apple du paquet.
- Stapling du ticket notarization.

Placeholder commandes:

```bash
# codesign placeholder
codesign --deep --force --verify --verbose --sign "Developer ID Application: <TEAM>" build/.../OrcaSlicer.app

# notarization placeholder
xcrun notarytool submit <archive.zip> --keychain-profile "<PROFILE>" --wait

# staple placeholder
xcrun stapler staple build/.../OrcaSlicer.app
```
51 changes: 51 additions & 0 deletions docs/ai/SAFETY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# AI Slice Assistant Safety

## Scope And Guardrails

AI Slice Assistant is designed for **slicer settings assistance only**.
It is not a general chatbot and should not be used for non-slicing topics.

Core safety boundaries:

- JSON contract responses only.
- Contract/schema validation before UI use.
- Business-rule checks (version, limits, value ranges).
- Allowlist-based setting filtering and value validation.
- Apply pipeline is controlled and reversible with undo.

## Safe Mode (Default ON)

Safe Mode is enabled by default and adds stricter runtime limits:

- Maximum of 10 recommended changes shown/applied.
- High-risk keys are blocked.
- Temperature/flow/speed related changes are marked as requiring user confirmation.

## Validation And Repair

Before recommendations are accepted:

1. JSON parsing must succeed.
2. Schema validation must pass.
3. Business rules must pass.

If validation fails, a repair request is sent with validation errors, and retries are limited.
If still invalid, output is rejected.

## Apply Safety

When applying recommendations:

- Only allowlisted keys are eligible.
- Values must match expected type and bounds.
- Apply is atomic (all-or-nothing).
- Original values are captured for undo.

## Operator Responsibility

AI suggestions can be wrong or suboptimal for your setup.
You are responsible for reviewing and validating each proposed change before printing.

## Disclaimer

AI suggestions are not guaranteed. Always verify recommendations before applying them to real prints.
79 changes: 79 additions & 0 deletions scripts/release/macos_beta_package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"

if [[ "$(uname -s)" != "Darwin" ]]; then
echo "Erreur: ce script doit etre execute sur macOS." >&2
exit 1
fi

cd "${REPO_ROOT}"

echo "[1/4] Build macOS..."
./build_release_macos.sh

echo "[2/4] Recherche de OrcaSlicer.app..."
app_path=""
for candidate in \
"${REPO_ROOT}/build/arm64/src/Release/OrcaSlicer.app" \
"${REPO_ROOT}/build/x86_64/src/Release/OrcaSlicer.app"; do
if [[ -d "${candidate}" ]]; then
app_path="${candidate}"
break
fi
done

if [[ -z "${app_path}" ]]; then
app_path="$(find "${REPO_ROOT}/build" -type d -path '*/src/Release/OrcaSlicer.app' | head -n 1 || true)"
fi

if [[ -z "${app_path}" || ! -d "${app_path}" ]]; then
echo "Erreur: OrcaSlicer.app introuvable apres build." >&2
exit 1
fi

arch="$(uname -m)"
if [[ "${app_path}" == *"/build/arm64/"* ]]; then
arch="arm64"
elif [[ "${app_path}" == *"/build/x86_64/"* ]]; then
arch="x86_64"
fi

git_hash="$(git rev-parse HEAD)"
build_date_utc="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
date_tag="$(date -u '+%Y%m%d')"
macos_version="$(sw_vers -productVersion)"

artifacts_dir="${REPO_ROOT}/build/release"
mkdir -p "${artifacts_dir}"

stage_dir="$(mktemp -d "${TMPDIR:-/tmp}/orcaslicer-beta.XXXXXX")"
cleanup() {
rm -rf "${stage_dir}"
}
trap cleanup EXIT

echo "[3/4] Preparation du package..."
cp -R "${app_path}" "${stage_dir}/OrcaSlicer.app"

cat > "${stage_dir}/BUILD_INFO.txt" <<EOF
project=OrcaSlicer-AI
git_hash=${git_hash}
build_date_utc=${build_date_utc}
macos=${macos_version}
arch=${arch}
app_path=${app_path}
EOF

zip_name="OrcaSlicer-AI-beta-${arch}-${date_tag}-${git_hash:0:7}.zip"
zip_path="${artifacts_dir}/${zip_name}"

echo "[4/4] Creation de l'archive..."
(
cd "${stage_dir}"
/usr/bin/zip -qry "${zip_path}" "OrcaSlicer.app" "BUILD_INFO.txt"
)

echo "ZIP cree: ${zip_path}"
Loading